Article
Custom Claims and Role-Based Access Control (RBAC)
Supabase · Supabase Docs Free Advanced
Once you need real roles (admin, member, viewer), this shows the clean pattern: store roles and permissions in tables, put the role in the user's token, then check it in your policies. It is the deeper follow-up to basic RLS when a single owner check is not enough. Use it when different kinds of users need genuinely different access.
- Model roles and permissions as tables, not scattered checks
- Carry the role in the user's token via an auth hook
- Enforce the role inside your security policies