RLS bloqueando INSERT mesmo com policy WITH CHECK (true) e current_user = anon #48398
Replies: 3 comments
|
Not much info. |
|
A permissive 1. RLS is enabled but you only fixed INSERTIf SELECT (or UPDATE) policies are missing, inserts can succeed server-side yet the client 2.
|
|
Complementando as duas respostas acima — two things that can still block an INSERT even when the 1. A restrictive policy elsewhere on the same table. Permissive policies are OR'ed together, but any policy created select polname, polcmd, polpermissive,
pg_get_expr(polwithcheck, polrelid) as with_check
from pg_policy
where polrelid = 'public.your_table'::regclass;Rows with 2. The violation may be coming from a different table, via a trigger. The error text names the table it failed on: If neither turns anything up, post the exact error line plus the output of (For reproducing this class of failure locally: I keep a runnable two-role isolation fixture at cekuu35/supabase-rls-leak-demo — the same test suite goes red on the broken branch and green on the fixed one, no cloud project needed.) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
All reactions