https://supabase.com/ logo
I am asking myself if there is a possibility for R...
# help
g
I am asking myself if there is a possibility for RLS policies to exclude columns. Like a User could edit everything in his profile, except his UserRole Column, is there something like that possible ? Or is there a way to get the Data that should be inserted and check them ? Like if UserRole!=null -> Reject ?
n
Hello @Gianni! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
g
There is no RLS for columns. Postgres has column grants based on roles. https://www.enterprisedb.com/postgres-tutorials/how-implement-column-and-row-level-security-postgresql It can be a bit tricky to use. You can also just do a before update trigger function and set new.col = old.col and return new. You can do more in the same function if you want to allow different roles to modify or lock other cols like created_at.
s
Yeah I would go the before update trigger function route.