Forum Discussion
Row Level Security with several rows for one user
We're using RLS but we're running into a problem with our rights table.
We have programs to which users want access. But users can have access to multiple programs and multiple users can have access to the same program.
As a result the relationship between program and users is many to many which as far as I know doesn't work with RLS. Does anyone know how to fix this problem?
It will work even with M:M relationships as long as your RLS rules only flow in one direction, from the RLS definition table to the fact table.
You can combine rules per user, or rely on the RLS engine to do the Venn diagram for you. Note that permissive rules override restrictive rules.
2 Replies
- lbendlinSuper User
It will work even with M:M relationships as long as your RLS rules only flow in one direction, from the RLS definition table to the fact table.
You can combine rules per user, or rely on the RLS engine to do the Venn diagram for you. Note that permissive rules override restrictive rules.
- Allard_SwartRegular Visitor
Hi Ibendlin,
Thanks for the reply. You're right it does work with M to M. Great that solves my problem. This helps alot.