Menu

Supabase 42501: Your RLS policy might be fine. You're missing a GRANT.
📰

Supabase 42501: Your RLS policy might be fine. You're missing a GRANT.

DEV Community: express·SYED SHAAMEER Ali·about 14 hours ago
#6z6WB2lU
#devtoexpress#devto#dev#user#profile
Reading 0:00
15s threshold

You create a new table, add RLS policies that look perfect, and your API calls fail with:

error code 42501: permission denied for table profiles

Your RLS policies might be perfectly fine. The problem could be one layer below RLS: PostgreSQL privileges.

Supabase's recent default change makes this especially important. Here's what changed, the SQL that fixes it, and a two-user test to check that your policies still hold.

What changed

Supabase no longer automatically grants the API roles (anon, authenticated, and service_role) access to newly created tables in the public schema by default.

Here's the timeline:

April 28, 2026: Supabase introduced the option to create projects without automatically exposing new tables.

May 30, 2026: The new behavior began rolling out as the default for new projects.

October 30, 2026: The change was applied to existing projects.

Once this change reaches your project, newly created tables in the public schema require explicit grants before the Data API can access…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.