Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

RLS does not work

The data I have I get from AD. It's a default table which I've added some columns to

UserManagerIdManager IDLoginOrg Level 1Org Level 2Org Level 3PathPath User
AB12[email protected][email protected][email protected][email protected]3|2|1A|B|C
BC23[email protected][email protected][email protected] 3|2B|C
C 3 [email protected][email protected]  3C

 

But when I add RLS it just does not work.

If I view the role as 'User' I only can see myself (User B), not the people below me.

If I view the role as 'Other User' it does not matter what I put in there, I still can see everyone. There is just no filtering on the user table.

 

I've tried the following dax codes in my RLS user table:

 

 

 

PATHCONTAINS(
User[Path User],
LOOKUPVALUE(
User[User],
User[Login],
USERPRINCIPALNAME()
)
)
-----------------------------------------------------------------------------------------------------------------------------------------------
PATHCONTAINS(User[User],
MaxX(
Filter(
User,
[Login]=USERPRINCIPALNAME()
)
, User[User]
)
)
-----------------------------------------------------------------------------------------------------------------------------------------------
VAR Agents =
CALCULATETABLE (
VALUES ( 'User'[User] ),
'user'[Manager] = USERNAME())

RETURN
IF('Agent name'[login] IN Agents, TRUE, FALSE)
-----------------------------------------------------------------------------------------------------------------------------------------------
LOOKUPVALUE(
User[User],
User[User],
RIGHT(USERNAME(), USERNAME())

-----------------------------------------------------------------------------------------------------------------------------------------------
[Login] = USERPRINCIPALNAME()
|| [Org Level 3] = USERPRINCIPALNAME()
|| [Org Level 2] = USERPRINCIPALNAME()
|| [Org Level 1] = USERPRINCIPALNAME()

 

 

 

With all I have the same result

 

3 Replies