flâneur — a map of the web's best reading

Row Level Security | Supabase Docs

supabase.com · 3,502 words · saved by 1 readers

Postgres Row Level Security (RLS) is a feature of Postgres that allows you to control which users are permitted to perform SELECT/INSERT/UPDATE/DELETE statements on specific rows within tables and views. For example, you could restrict a blog_post table such that the current user is only allowed to UPDATE rows where their user id is set in the table's author_id column. Supabase Auth is designed to work perfectly with RLS. You can use RLS to create Policies that are incredibly powerful and flexible, allowing you to write complex SQL rules which fit your unique business needs. Policies are easy to understand once you get the hang of them. Each policy is attached to a table, and the policy is executed every time a table is accessed. You can just think of them as adding a WHERE clause to every query. For example a policy like this ... .. would translate to this whenever a user tries to select from the todos table: Supabase Auth maps every request to one of the roles: These are actually Pos

Row Level Security Secure your data using Postgres Row Level Security. When you need granular authorization rules, nothing beats Postgres's Row Level Security (RLS) . Row Level Security in Supabase # Supabase allows convenient and secure data access from the browser, as long as you enable RLS. RLS must always be enabled on any tables stored in an exposed schema. By default, this is the public schema. RLS is enabled by default on tables created with the Table Editor in the dashboard. If you create one in raw SQL or with the SQL editor, remember to enable RLS yourself and grant only the permissi

Explore this link on the map →

saved by

related reading