© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
2 replies
felsey

RLS with a join table

I can't for the life of me figure this one out 🤦‍♂️

I have a table of for
lists
lists
and a table for
user_list_relations
user_list_relations
. The
user_list_relations
user_list_relations
table is joined with the
lists
lists
table via the list_id.

The
user_list_relations
user_list_relations
table also has a column called
user_profile_id
user_profile_id
which match the auth.uid().

I need to setup RLS so that a user can read, instert, update, or delete a list if they have a
user_list_relation
user_list_relation
for that list.

I'm assuming the correct order of operations when creating a new list is:

1. Insert a new row for the list
2. Create the user_list_relation using the list_id from the list that was just created.

But, I'm not sure how this all comes together with RLS.

Let me know what additional info I can provide. Thanks!
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

RLS With Join Table
SupabaseSSupabase / help-and-questions
4y ago
RLS Policy With Join
SupabaseSSupabase / help-and-questions
4y ago
Simple RLS Policy with Join
SupabaseSSupabase / help-and-questions
4y ago
Writing RLS policy with join
SupabaseSSupabase / help-and-questions
4y ago