Error uploading document - new row violates row-level security policy
i have bucket - onboarding-documents. inside it there are 2 folders, license and cmr-insurance.
INSERT & UPDATE:
SELECT:
however when i insert through my frontend:
i seem to get this error:
Error uploading document: {
statusCode: '403',
error: 'Unauthorized',
message: 'new row violates row-level security policy'
}
3 Replies
You don't show the entire policies.
Where do you add the extension to the path name?
You should simplify to bucket and true for the USING/WITH CHECK clauses and build up until it fails.
I can help fix your Supabase RLS issue causing the 403 Unauthorized error. It likely comes from the INSERT policy not matching the authenticated user. Are you setting owner_id from auth.uid() during the upload?
@Borislav Borisov
yes, the problem was i that i wasn't adding the extension, but i've since figured it out. thank you for the adequate response.