Replies: 1 comment 2 replies
-
Supabase appears to have made that guide only allow one role per user. Both the claim not being an array and the table having a unique column with both role and id enforce that. But it is just an example. You could certainly create an array for the role claim and change the constraint. But you would also then have to deal with RLS on the role treating it as an array of roles in your policies. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm modifying the RBAC example from https://supabase.com/docs/guides/database/postgres/custom-claims-and-role-based-access-control-rbac, and it seems like the assumption (in
public.custom_access_token_hook
andpublic.authorize
) is that a user can only have one role at a time. However, thepublic.user_roles
table has the constraintunique (user_id, role)
. Should that beunique(user_id)
or am I misunderstanding something?Beta Was this translation helpful? Give feedback.
All reactions