© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•13mo ago•
4 replies
freak4pc

Owner/Auth-based RLS Policy always fails

I added a RLS Policy to allow a user to only insert if the owner_id is themselves:

alter policy "Enable insert for users based on user_id"
on "public"."memories"
to public
with check (
  (( SELECT auth.uid() AS uid) = owner_id)
);
alter policy "Enable insert for users based on user_id"
on "public"."memories"
to public
with check (
  (( SELECT auth.uid() AS uid) = owner_id)
);


I try to insert a row with my currently-authenticated User ID from the Supabase SDK and getting:
new row violates row-level security policy for table "memories"

I even tried to hard-code it to the only person ID in the auth table: 89258579-eb05-48d0-b74d-87ad6f790c32
Am I missing anything? Thanks!
Screenshot_2025-01-27_at_9.32.07.png
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

RLS Policy
SupabaseSSupabase / help-and-questions
4mo ago
RLS policy including a auth.uid() statement
SupabaseSSupabase / help-and-questions
3y ago
Restrictive RLS policy
SupabaseSSupabase / help-and-questions
2mo ago
RLS policy help
SupabaseSSupabase / help-and-questions
3y ago