Can't access a table using RLS.

Hi! I created two RLS policies: INSERT for authenticated users only and the same for SELECT (check screenshots).

Then I try to INSERT a new row into this table and get this error: postgrest.exceptions.APIError: {'code': '42501', 'details': None, 'hint': None, 'message': 'new row violates row-level security policy for table "kisis_forms"'}

I use these docs for Supabase Py: https://github.com/supabase-community/supabase-py

So initially I create a client:
from supabase import create_client, Client
supabase: Client = create_client(url, key)

#Afterwards I do the auth:
email: str = str(user_mail)
password: str = str(user_pass)
supabase.auth.sign_in(email=email, password=password)

#Then I try to INSERT a new row and recieve mentioned error:
data = supabase.table(table_name).insert({"tg_id": user_id, "name": name}).execute()


Guys, could you please help me to resolve this?
unknown.png
GitHub
Python Client for Supabase. Contribute to supabase-community/supabase-py development by creating an account on GitHub.
Was this page helpful?