Public read-only table
Anyone reads. Only your server writes. Here is the SQL.
-- public.your_table: public read
alter table public.your_table enable row level security;
revoke all on table public.your_table from anon, authenticated;
grant select on table public.your_table to anon;
grant select on table public.your_table to authenticated;
grant select, insert, update, delete on table public.your_table to service_role;
drop policy if exists your_table_read_all on public.your_table;
create policy your_table_read_all on public.your_table
for select to anon, authenticated
using ( true );
Line by line
| Line | Why |
|---|---|
enable row level security | Without it, a granted table has no row filter at all. |
revoke all ... from anon, authenticated | Starts from a known state. Supabase's RLS guide does this before granting back. |
grant select ... to anon and authenticated | Signed-out and signed-in requests run as different roles. Both need read. |
grant ... to service_role | Lets server-side code write the rows. |
create policy ... using ( true ) | Allows every row for the two client roles. Use only for data meant to be public. |
Fits: announcements, a product catalogue, published blog posts, lookup tables. Does not fit: anything with an email, a name or a user id in it.
Write the fix for your tables
One table is free. The whole schema with a rollback file is $9 one-time, free during launch.
Waiting for a paste.
Who can reach each table
Your tables show up here, one row each, with a choice of who can reach them.
The SQL appears here as soon as a table is found.
Parsed in your browser. Your SQL is never uploaded, and no site or database is scanned.
Questions
Can signed-in users write with this?
No. They only have select. Use Owner only if users should write their own rows.
Sources
- Supabase docs: Row Level Security, read 2026-11-10
- Supabase docs: Securing your API, read 2026-11-10
Related
- 42501: permission denied for tableThe role has no grant on the table. Paste the error or your table and get the SQL.
- Grants for anon, authenticated and service_roleThree roles, four privileges. This is the grid the tool fills in.
- Replit app says "permission denied for table"The new table has no grants. Paste it below and copy a fix prompt made for Replit.
- Owner-only tableEach signed-in user sees and changes only their own rows.