Forum Discussion
RLS not working for only one table
- 1 year ago
I managed to solve this issue by doing a workaround because for some reason RLS doesn't seem to work with bidirectional many-to-many relationships. That was the problem. So to "solve" this, I needed to create a bridge table with two columns: one for the distinct ID that would relate to all the other tables, and another for the RLS Code. Then I applied RLS only to this bridge table, and it worked.
That is interesting, are those relationships bi-directional to the child tables? Maybe that has something to do with it.
I think it would be to your benefit to figure out to how to relate your _UserManagement table to your models and have it do the RLS but that's more based on my experience
Yes, Table_E relates to its four child tables bidirectionally. What I find very strange is that, even when I leave only the TRUE() function in RLS, Table_E still doesn't display any data, but the four child tables display data. Very strange.
And _UserMangement table has no relationship with other tables.