I have created this table which links users to communities. These users have specific fields for communities, like whether they are admin, which are in the same table as well.
However, I am unsure how I should set up my RLS. What I want:
For INSERT rights:
1. Any user is free to insert a new row if is_admin and is_accepted are FALSE.
2. A row can be inserted with is_admin = TRUE and is_accepted = TRUE only when the created_by field in the Community table is the same id as the user
For UPDATE rights:
1. The is_accepted and is_admin field can only be updated when the user updating is admin
Koen
05/25/2023, 2:28 PM
I am wondering if these are things that should be combined in one table or split up across multiple small tables. I am also wondering if views are the solution