Supabase gives the browser a key that talks straight to your database. There is no API server in the middle deciding who gets what, which means your Row Level Security (RLS) policies are your application's actual permission layer.
Most tutorials stop at auth.uid() = user_id . Real apps need roles, team tenancy, paid content access, and public pages with private drafts. Here is how RLS works in practice, five common architectural patterns, security mistakes to avoid, and how to test your rules before shipping.
How RLS Works in Supabase
Every request to the Supabase Data API runs as one of three Postgres roles:
anon : No signed-in user. RLS applies.
authenticated : A signed-in user's access token is present. RLS applies.
service_role : Your server, using a secret key.…