Forum Discussion
Row Level Security (RLS)
Thanks, Greg_Deckler. Technically, I could do a merge query on Opportunities that brings in the related information from teams, business units, etc, but that seems like a fundamental shortcoming of RLS right now. I would assume that I can filter 'grandparent' and 'parent' records based on my selection criteria on the child record.
By way of example, let's say the Opportunity is owned by John Smith. And the Users table has John Smith and several other people in it. And then the Aggregated Users table shows that John Smith is on Team A. Then if I have a RLS role where Aggregated Users = Team A, then I would assume I could use that to filter the Users table so only John Smith is returned, and then in turn this would filter the Opportunity table so that only the record owned by John Smith is returned.
The alternative is a series of merged fields and an excessive number of roles that cover every eventuality. THAT would be a huge pain in the neck.
Hopefully, I am overlooking something obvious here. Or perhaps RLS really just isn't ready for primetime yet?
Best,
Scott
Hi Anonymous,
Based on your description, "System Users, Aggregate" table (Many side) and "System Users" table(One side) have many to one relationship, when you create a RLS role where "System Users, Aggregate > Business Unit = 'Division 1'", it doesn’t filter "System Users" table, right? If that is the case, we reported this issue internally two months ago and got an update from our product team that this behavior of RLS is by design. For more details, please check this similar thread.
Currently, to make RLS work as expected in your scenario, you will need to merge query on Opportunities and create a RLS role that Business Unit = 'Division 1' in Opportunities table.
Thanks,
Lydia Zhang