RLS Policy on Insert #270
-
|
Hi! I read up on Row Level Security and I'm trying to implement it in our supabase database. We have a table of I've already implemented the read access part for admin users, but I'm having trouble with the CREATE POLICY "Allow all insert access" on subscribers FOR INSERT WITH CHECK (true);However, when I try to insert a subscriber, this error shows up: Uncaught (in promise) Error: {"hint":null,"details":null,"code":"42501","message":"new row violates row-level security policy for table \"subscribers\""}Hope I can ask for help on this! I also checked if the docs already have support for Policies and saw that it is still in the list of issues to do. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
|
Hey @inbytesdevteam I think this could be an issue with postgrest-js(which supabase-js uses underlyingly). I've reported it here: supabase/postgrest-js#127. |
Beta Was this translation helpful? Give feedback.
-
|
Hey @inbytesdevteam! Sorry this took so long. This is now merged in supabase-js, and will be released in the next version. Then you can do: await supabase.from('subscribers')
.insert({...}, { returning: 'minimal' })And likewise for other write-only tables. Ref: supabase/postgrest-js#133 |
Beta Was this translation helpful? Give feedback.

Hey @inbytesdevteam! Sorry this took so long.
This is now merged in supabase-js, and will be released in the next version. Then you can do:
And likewise for other write-only tables. Ref: supabase/postgrest-js#133