Forum Discussion

IoanaSluby's avatar
IoanaSluby
Frequent Visitor
6 years ago
Solved

Configure Row Level Security with OR condition

Hi!   I have a main datasource which contains data about worklogs, grouped by month/year/project and employee, with these fields: - Employee - Project - Month  - Year - Time in hours  - Emplo...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi,

     

    You can apply RLS to the main table (WorkLogs) instead of the RLS table and check like this:

    = CONTAINS('RLSTable', 'RLSTable'[User], USERPRINCIPALNAME(), 'RLSTable'[division], 'WorkLogs'[Employee division])

    || CONTAINS('RLSTable', 'RLSTable'[User], USERPRINCIPALNAME(), 'RLSTable'[division], 'WorkLogs'[Project division])

     

    You don't need any relations between the two tables. Caching of RLS will stop working if you have more than about 130 000 rows, but if the table is not too big it will probably work even if you exceed that number.

     

    If performance is not good enough with the above solution, my suggestion is to add some kind of bridge table between the WorkLogs table and RLStable that connects worklog rows with rows in the RLS table.

     

    Best Regards // Ulf