Unable to Insert Data into Supabase users Table Due to Row Level Security (RLS)

I am experiencing an issue where I cannot insert data into the users table in my Supabase database. The operation fails due to Row Level Security (RLS) being enabled. Although the table structure is correct and the insert query is valid, Supabase returns a permission error indicating that the insert operation is not allowed under the current RLS policy. This is preventing me from creating or registering new data entry in the table through my application. I suspect that no insert policy has been defined for the users table, or that the existing policy does not allow inserts for the current session role (typically anon or authenticated). I need to correctly define and apply an RLS policy that securely permits user insertion while maintaining proper access control which I think have dont but it doesnot allow entering new data into the table. The given are my table info and the policy that i have created.
No description
No description
1 Reply
garyaustin
garyaustin4w ago
I'm confused. You mention user table then a transaction table and policies for it are shown. What is your insert code? If the transaction table you show is not working then most likely you don't have a user session when you make the call. Check in the API Gateway log for the insert (POST) and see what the role is.

Did you find this page helpful?