Forum Discussion
Filtering column by dynamic role
- 6 years ago
That's actually a conflict. If you are limiting visibility to a certain company by using RLS then that will prevent that user from seeing the data from the other companies.
Reza Rad describes that scenario in great detail, but the gist is that you would need to create a second shadow set of tables that is hidden from view, and not governed by RLS. That way you can compare the current selection to the complete data set.
HUGE WARNING: Security by Obscurity does not work. Any sufficiently knowledgeable user can crack this setup in seconds and get access to data they should not see based on the RLS.
That's actually a conflict. If you are limiting visibility to a certain company by using RLS then that will prevent that user from seeing the data from the other companies.
Reza Rad describes that scenario in great detail, but the gist is that you would need to create a second shadow set of tables that is hidden from view, and not governed by RLS. That way you can compare the current selection to the complete data set.
HUGE WARNING: Security by Obscurity does not work. Any sufficiently knowledgeable user can crack this setup in seconds and get access to data they should not see based on the RLS.
That's what I thought. Adding tables made it work as wanted. Thank you for your guidance!
Julia