Forum Discussion

Chewdata's avatar
Chewdata
Responsive Resident
8 months ago
Solved

RLS Filtering additional dimensions

Hello!  I can use your help with a Row Level Security question.  I have a model on which I applied RLS based on the UPN, which works fine. RLS filters the table Team (bridge) which in turn fil...
  • xifeng_L's avatar
    8 months ago

    Hi Chewdata 

     

    Your approach is correct; you need to add restrictions for Behandelaren and Reviewers to the RLS role, but the expression you used is wrong.

     

    You should first filter out the Teams permissions that the current user has, and then use those items to restrict Behandelaren and Reviewers.

     

    In short, you need to change Behandelaren[Team] IN VALUES(Team[Team]) to:

     

     

    VAR AccessTeamItems = 
        CALCULATETABLE(
            VALUES(RLS[Team]),
            RLS[UPN]=USENAME(),
            ALL()
        )
    RETURN
    Behandelaren[Team] IN AccessTeamItems
    // Reviewers[Team] IN AccessTeamItems

     

     

    Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

     

    Thank you~