Append data in many-to-many relationship
I have two tables:
Team members can have varying privileges in their teams. They can have no privileges (received an invite), read-only (invited as a user) and read-write-delete (team manager).
I can solve this by having three different join tables:
I'd like to be able to define their role directly in the join table, and be able to use this when writing RLS policies. Is this possible? - and if so, how do I go about it?
Thanks (:
teams and members. These two are joined by a many-to-many table, which holds of course its own ID, team_id and member_id, as a composite primary key. Team members can have varying privileges in their teams. They can have no privileges (received an invite), read-only (invited as a user) and read-write-delete (team manager).
I can solve this by having three different join tables:
project_invites, project_members and project_admins. This seems lame. I'd like to be able to define their role directly in the join table, and be able to use this when writing RLS policies. Is this possible? - and if so, how do I go about it?
Thanks (: