Skip to main content
Sealgap

What is a database grant?

A grant is a statement that gives a database role the right to do something with a table: read it, add to it, change it or delete from it. Without a grant, the role cannot touch the table at all, whatever else is set up.

grant select on public.products to anon;

The roles in a Supabase app

When an app in the browser talks to Supabase, every request runs as one of two roles. The anon role is a visitor who has not signed in. The authenticated role is everyone who has. The service_role is used by server code and bypasses the access rules, which is why its key must never reach the browser.

A grant to anon is a decision about strangers. A grant to authenticated is a decision about every account in the app, and in a project that lets anyone sign up, that is close to the same thing.

Grants and Row Level Security are two layers

  • A grant decides whether a role may use the table.
  • Row Level Security decides which rows the role gets.

Both have to be right. A grant with Row Level Security switched off hands the role every row. A grant with a policy whose condition is always true does the same in a less obvious way. No grant at all keeps the table closed to the browser, which is right for tables that only server code uses.

The details of how PostgreSQL handles privileges are in its documentation for GRANT.

What changed in 2026

Supabase used to grant both browser roles every right on every new table in the public schema, which left a table without Row Level Security open from the moment it was created. That automatic step was removed in stages during 2026, and it no longer happens in any project from 30 October 2026, as the Supabase changelog describes. A new table now answers the app with "permission denied for table" until someone grants access.

The quick fix for that error, granting everything to everyone, puts a project back where it was. Granting only what each screen needs is the better habit. What the change means for delivered apps goes through it step by step.

Also known as

GRANT table privileges Data API access

Free check

See what one of your apps answers.

Certificate, browser protections and keys in public code. No account needed.

See what one of your own apps answers.

The free check looks at an app from the outside: whether it answers, its certificate, its browser protections and keys in its public code.