© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•8mo ago
Charcoal

RLS on related table

Hey, I've got two tables:
mods
mods
, with the columns
id
id
,
user_id
user_id
,
mod_text
mod_text

mod_tags
mod_tags
, with the columns
id
id
,
mod_id
mod_id
,
type
type


mods
mods
has a one to many relationship to
mod_tags
mod_tags
, through
mods.id
mods.id
to
mod_tags.mod_id
mod_tags.mod_id


In my JS code, I upsert any modifications to the row in
mods
mods
, then I try to insert any new rows into
mod_tags
mod_tags
.

Updates to
mods
mods
are all good, it's been running fine for ~1.5 years with a very basic RLS, checking the
mods.user_id
mods.user_id
row vs the authenticated user.

But I've recently added
mod_tags
mod_tags
and I need to check the relation to the row in
mods
mods
to get the
user_id
user_id
column. I've spent at least an hour with the LLM on the site and haven't got anywhere.

Can anyone point me in the right direction on how to get this working?
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 on Likes Table
SupabaseSSupabase / help-and-questions
4y ago
Security RLS policy on users table
SupabaseSSupabase / help-and-questions
7mo ago
RLS Policy on a link table
SupabaseSSupabase / help-and-questions
4y ago
RLS on INSERT with linking table
SupabaseSSupabase / help-and-questions
4y ago