Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Toggling dynamic row level security

I'm trying to figure out how I can toggle row-level fitering or security for a certain use-case.  My customers are expecting to be able to toggle between seeing: All of the data that their (in)dire...
  • Anonymous's avatar
    Anonymous
    7 years ago

    I was able to work out a solution by adding another dimensional table and applying RLS against that.

    • I applied bidirectional filtering to the new table, but did not apply security in both directions.
      • This way, with RLS applied to DIM_Cost_Center, I start with only the cost centers that each employee is permitted to see.
      • This table then filters which cost centers are accessible from DIM_Cost_Center_Selection[Selection]="All".
    • The second RLS filter limits which records are visibile in DIM_Cost_Center_Selection[Selection]="Mine"

    Now I'm able to throw slicers on the canvas where the end-user specifies DIM_Cost_Center_Selection[Selection] and all visuals (including additional slicers) update accordingly.

     

     
    DIM_Cost_Center
       
    DIM_Cost_Center_Selection
     
    Cost CenterCost Center NameOwnerCost CenterEmail AddressSelection
    001ApplesAdam001[email protected]All
    002BananasAdam002[email protected]All
    003CarrotsBrad003[email protected]All
    004DatesBrad004[email protected]All
    005EggplantsCharlie005[email protected]All
       001[email protected]Mine
    ╚════════════  ⇔══════002[email protected]Mine
        003[email protected]Mine
        004[email protected]Mine
        005[email protected]Mine

    RLS:

    Filter on Owner using employee org chart

      

    RLS:

    Or(DIM_Cost_Center_Selection[Email Address]=USERPRINCIPALNAME(), DIM_Cost_Center_Selection[Selection]="All")