ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabaseโ€ข4y agoโ€ข
9 replies
KTibow

Can I only allow viewing some columns in RLS?

Right now, I have two tables.
chat
chat
: a table that has chat messages with data like the contents and email of the sender for each message, with a foreign key relation based on the email
schoology_users
schoology_users
: a table that has information from an external service, like oauth keys, and the name and profile picture of the person
In order to display the chat message, I use something like
  supabase
    .from("chat")
    .select(
      `
      *,
      schoology_users (
        name,
        profile_picture
      )
      `
    )
  supabase
    .from("chat")
    .select(
      `
      *,
      schoology_users (
        name,
        profile_picture
      )
      `
    )

I don't want to allow people to view the auth keys for each person anonymously, but the query doesn't work with the anon key once I enable RLS for
schoology_users
schoology_users
. What should I do here?
(Also feel free to suggest a better title and/or tags, could be my actual solution would be different from what I think)
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

Allow RPC only for RLS query
SupabaseSSupabase / help-and-questions
4y ago
RLS for Columns?
SupabaseSSupabase / help-and-questions
3y ago
Restrict columns with RLS
SupabaseSSupabase / help-and-questions
3mo ago
How can I allow authenticated users to access only certain columns from a table ?
SupabaseSSupabase / help-and-questions
13mo ago