© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
24 replies
Tobi

Restrict read access to public Bucket possible?

Is it possible to restrict read/select access to a public bucket?

The behaviour I would like to achieve is that I store an image url in a profile table. Once a user retrieves that data and wants to access the image url, the RLS policy should check that the user is authenticated. Is that possible?

I am not sure if I understand the docs correct. There it is stated that public buckets always bypass the select policies. On the other hand, private buckets urls are only valid for a time x. So if I store a private url in a database table, that url might me invalid if another authenticated user feteches it. If I store it as public url, every anon user can retrieve it?

What is the solution here?
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

Using views to restrict access.
SupabaseSSupabase / help-and-questions
13mo ago
Delete from bucket based on public URL
SupabaseSSupabase / help-and-questions
2mo ago
How to restrict access based on many-to-many relationship
SupabaseSSupabase / help-and-questions
4y ago
Getting Unauthenticated Error While uploading files to a public bucket
SupabaseSSupabase / help-and-questions
4mo ago