Supabase answers
Custom Postgres Roles and RLS in Supabase
Yes, you can define your own custom PostgreSQL roles and use them with RLS in Supabase. This is a powerful feature for implementing sophisticated Role-Based Access Control (RBAC) [1, 2].
The key is to understand that Supabase's built-in auth.uid()
function and authenticated
role are tied to the user's session. To use custom roles, you need to store this role information and make it accessible to your RLS policies.