© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
1 reply
((()))

RLS check current user has a role, if so delete

I have a table where each user has a role that's either admin or default.
I want to allow only those who have role = admin to delete rows from this table. Right now it's very counter-intuitive when I try to make a policy as seen in screenshot. What am I missing? With current policy I can only delete users that have role = admin and those with role default are rejected.

I want only those signed in users who have role=admin be able to delete users
unknown.png
unknown.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

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

DELETE user_role RLS fails silently instead of returning RLS error to user
SupabaseSSupabase / help-and-questions
4y ago
Does a user with the role 'supabase_admin' bypass RLS
SupabaseSSupabase / help-and-questions
4y ago
Check if row already exists with RLS.
SupabaseSSupabase / help-and-questions
4y ago
RLS Condition check
SupabaseSSupabase / help-and-questions
4y ago