Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Row level security at different levels

Hi,

 

I have data made up of lots of shops which feed into areas, which in turn feed into larger regions. As a test I've managed to set up three row level securities that map people to shops, areas and regions. But I don't understand how to elegantly control permissions for different jobs titles - e.g. all staff can be mapped to a branch number, but shop managers should only see their branch, area managers should only see branches in their area, and region managers should only see shops in their region. Please can you tell me how to create a single permission that elegantly handles all of this?

 

Thanks,

 

CM

 

 

3 Replies

  • The answer to this depends on what your data model looks like and how you map staff to branches.

     

    If your Branch table has columns for BranchManager, AreaManager and RegionManager that contains the Username  you could simply create an RLS filter condition like the following:

    = Branch[BranchManager] = USERNAME() || Branch[AreaManager] = USERNAME() || Branch[RegionManager] = USERNAME()

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the reponses.

       

      We also have some floating employees that will need a mix of permissions. For example a consultant may need access to 4 areas in the same region (but not all areas in that region). Another consultant may need access to several areas (but not all areas in each region) spread accross different regions. Please can you tell me if/how this is possible in Power BI?

       

      Many thanks,

       

      CM