Your new Supabase table is returning "permission denied for table" with error code 42501, and your app worked fine until now. The cause is a Supabase platform change, not your code, and the fix takes a few minutes once you know where to look.
What you are seeing
Picture this: your app has been running for months. You add one new table for a new feature — say, a reviews table — wire it up the same way as every other table, and the feature just fails. Reads fail, writes fail, and the error says permission denied for table, code 42501. Meanwhile every older table still works perfectly, which makes the whole thing feel random. It isn't random. Only the new table is affected, and that detail points straight at the cause.
Why it happens now
Supabase changed how new tables are exposed to the Data API. New tables in the public schema are no longer open to the API by default. The change rolled out in stages: it was opt-in from 28 April 2026, became the default for new projects on 30 May 2026, and on 30 October 2026 Supabase enforced it on all existing projects too. So a table you create today gets no API access until you grant it explicitly. Older tables keep whatever access they already had, which is why only the new one breaks. Your code did nothing wrong — the rules around it moved.
The minimum fix
Work through these in order, and test after step 4 before changing anything else.
- Confirm the error first. Open your app's logs or the failing request and check the code is really 42501 with the words "permission denied for table". If the code is different, you have a different problem, and these steps won't help.
- Find the role your app actually uses. Most apps talk to Supabase as either the anon role (visitors who aren't signed in) or the authenticated role (signed-in users). Your fix must target the role that makes the failing request, not every role.
- Grant access to that role, and only that role. In the Supabase dashboard, open the table and add an explicit grant for the operations your feature needs — read, write, or both. Grant the smallest set that makes the feature work.
- Check Row Level Security on the table. A grant alone is not enough when Row Level Security is on: your policies still have to allow the operation. If the policy blocks it, the same 42501 error comes back. Read the policy for the table and make sure it covers the role and the action you just granted.
- Test the feature again, exactly the way your user would use it — signed out if it is a public feature, signed in if it isn't. If it works, stop. Don't keep opening up more access "just in case".
One thing you should NOT do: don't grant full access to the anon role and switch Row Level Security off to make the error go away. That combination leaves the table open for anyone on the internet to read, and sometimes to write. If a guide tells you to run a blanket grant to anon without mentioning policies, close the guide.
When to get help instead
Handle it yourself when the error is 42501 on one new table and the steps above clear it. Bring in a developer when older tables start failing too, when your policies are tangled and you can't tell who should see what, or when the table holds real user data and you aren't sure what is safe to open. Guessing on a production table is how a small fix turns into a leak.
If this is your app, contact me through https://israr-kundi.web.app
Top comments (0)