Forum Discussion

IzBell's avatar
IzBell
Frequent Visitor
2 years ago

Role Level Security (RLS) based on Country and/or other criteria

Good day everyone,

I would like to create a DAX measure under Manage Security Roles with the following logic:

  • A small group of users can see all data in the table. 
  • The rest can only see data for the country they are based in, and with some additional exclusion criteria.


For example, I have a table called "Employee_List":

  • Anyone in Team = "aa" AND Department = "A", they can see everything.
  • The rest can see data for the country they are based in, except for data in Department = "A"
Employee IDEmployee NameEmailTeamDepartmentCountry
1007Alice[email protected]aaAUK
1000John[email protected]abAFrance
1001Abby[email protected]acBFrance
1002Ben[email protected]aeCUK
1003Sarah[email protected]abCUK
1004Jess[email protected]acDUSA
1005Bill[email protected]aaAUSA
1001Mark[email protected]abBFrance
1005Bob[email protected]acAUSA
1006James[email protected]adAFrance


For example:

 

  • Bob is based in USA. When he logs in can only see employees in USA- excluding Department A.
    Employee IDEmployee NameEmailTeamDepartmentCountry
    1004Jess[email protected]acDUSA

 

Your help would be much appreciated.
Many thanks,
IzBell

1 Reply

  • Brunner_BI's avatar
    Brunner_BI
    Impactful Individual

    This is quite complex that is why you do not get an answer quickly here.

     

    Here are the conditions:

    • Anyone in Team = "aa" AND Department = "A", they can see everything.
    • The rest can see data for the country they are based in, except for data in Department = "A"

    The first one is easy but this is not something you can solve with RLS. You need to create a security group in the active directory for these people. Alternatively, add them as contributors to the workspace so RLS does not even apply OR add them manually (i dont recommend this) to the "none" group or create a group in RLS without any filter. RLS is more about restricting data than giving full access.

     

    For your second condition I would also set up two AD groups, one for all other users and one for department A specifically.

    Then you set up RLS based on the country and just assign the "other than department A" people to that role.