Forum Discussion
Dealing with RLS and many-to-many relationship
- 2 years ago
hey KatTheDuck
Maybe you can create a bridge table that contains three columns: EmployeeID, DepartmentID, and a flag indicating if the employee is a manager/deputy (True/False). Then you can create one-to-many relationships from the Employee table to the bridge table and from the Department table to the bridge table, and you can set the RLS on the department ID in the bridge table where the manager/deputy flag is True.
hey KatTheDuck
Maybe you can create a bridge table that contains three columns: EmployeeID, DepartmentID, and a flag indicating if the employee is a manager/deputy (True/False). Then you can create one-to-many relationships from the Employee table to the bridge table and from the Department table to the bridge table, and you can set the RLS on the department ID in the bridge table where the manager/deputy flag is True.