Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

dynamic RLS

hello I have this table with the accesses that each user must have.
furthermore i created this rule, however with use the maxx is only the last value is returned
example: [email protected] should have access to "AAABBBCCCEEE" and "AAABBBCCCFFF".
with the current rule he only has access to "AAABBBCCCEEE".
Every help is welcome.
Thanks a lot for the help.
plaese apologize for my English

 

Emailaccess levelNameParentHierarchy
[email protected]AAAAAA AAA
[email protected]AAABBBBBBAAAAAA | BBB
[email protected]AAABBBCCCCCCBBBAAA  | BBB | CCC
[email protected]AAABBBCCCEEEEEECCCAAA | BBB | CCC | EEE
[email protected]AAABBBCCCFFFFFFCCCAAA | BBB | CCC | FFF
[email protected]AAABBBCCCHHHHHHCCCAAA | BBB | CCC | HHH

 

 

the rule

 

 

 

 

 

PATHCONTAINS(User[Hierarchy],
MaxX(
Filter(
User,
[Email]=USERPRINCIPALNAME()
)
,IF(User[Parent]="",User[Name],User[Name])
)
)

 

 

 

 

 

 

 

  • Hi Anonymous ,

     

    As the formula in the link you refer to you should create:

     

     

    Org Level 4 = LOOKUPVALUE (
        User[Email],
        User[Name],
        PATHITEM ( 'User'[Hierarchy], 4)
    )
    
    Org Level 3 = LOOKUPVALUE (
        User[Email],
        User[Name],
        PATHITEM ( 'User'[Hierarchy], 3)
    )
    
    Org Level 2 = LOOKUPVALUE (
        User[Email],
        User[Name],
        PATHITEM ( 'User'[Hierarchy], 2)
    )
    
    Org Level 1 = LOOKUPVALUE (
        User[Email],
        User[Name],
        PATHITEM ( 'User'[Hierarchy], 1)
    )

     

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    Best Regards,

    Dedmon Dai

11 Replies