Replies: 12 comments 26 replies
-
Update RLS policy requires a Using statement. With check is optional. |
Beta Was this translation helpful? Give feedback.
-
I just ran into a similar problem. |
Beta Was this translation helpful? Give feedback.
-
I DID fix my issue, I think what happened was I built some code originally from older docs/tutorials and had built out my own custom supabase client, which stopped working for some reason (still haven't had the time to diff the 2 files but will down the road). I make sure to use const supabaseClient = useSupabaseClient(); in my code before my queries... and import { useUser, useSupabaseClient } from '@supabase/auth-helpers-react' (at the top of the file) HTH, Rich |
Beta Was this translation helpful? Give feedback.
-
I fixed mine too. |
Beta Was this translation helpful? Give feedback.
-
Adding a policy seems like the best way, with this you don't need to disable the RLS policy and don't need to use a secret key which is very unsafe for your data. To do this, |
Beta Was this translation helpful? Give feedback.
-
I followed the tutorial in the Supabase Docs and the following policy is set: create policy "Profiles are viewable by users who created them."
on profiles for select
using ( auth.uid() = id ); This policy only allows reading entries. To also allow writing data, the policy can be set as follows: create policy "Profiles are viewable, editable, deletable by users who created them."
on profiles for all
using ( auth.uid() = id ); You can find a detailed description here: https://www.postgresql.org/docs/current/sql-createpolicy.html |
Beta Was this translation helpful? Give feedback.
-
additionally, if someone getting this error when he wanna get some files from a new bucket (you created) Here's the location of adding some policies into your bucket
|
Beta Was this translation helpful? Give feedback.
-
I was doing a quick and dirty test of inserting data so I created a blanket policy to allow INSERT. I was puzzled when I still got this error. My problem was that immediately after my .insert() I was calling .select() and I hadn't set up a READ permission yet. Once I took care of that everything worked as expected. |
Beta Was this translation helpful? Give feedback.
-
I was getting same error. Used pgsql. After lots of research i got to know that we need to add trigger for the respective table.
|
Beta Was this translation helpful? Give feedback.
-
Hi i need your help.
and my code is that :
and my widget is that :
i don't understand please help me |
Beta Was this translation helpful? Give feedback.
-
I am having the same issue and I am using the above recommendations. I am using nodejs to connect to the supabase and using "createclient" as below to create the connection. I am using public schemas for my tables and I have a reference key for
|
Beta Was this translation helpful? Give feedback.
-
Hi! I found a solution on my end |
Beta Was this translation helpful? Give feedback.
-
Hi I'm having trouble updating my User Table. If I disabled RLS well it has no problem it will update on the table.
User table
RLS Policy
Updating User Table
Beta Was this translation helpful? Give feedback.
All reactions