© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago
Ok-Panda4332

How to access bucket files with anon key and RLS?

1. I want to have read access with anon key. But creating a basic policy as below gives me access denied error.

create policy "Read access."
on storage.objects for select using (
    bucket_id = 'bucketname'
    and auth.role() = 'anon'
);
create policy "Read access."
on storage.objects for select using (
    bucket_id = 'bucketname'
    and auth.role() = 'anon'
);

URL - https://xyz.supabase.co/storage/v1/object/sign/bucketname/file.txt?token=anonkey
URL - https://xyz.supabase.co/storage/v1/object/sign/bucketname/file.txt?token=anonkey

I am having trouble writing SQL command for it.

2. Also if I make my bucket public without any RLS, can others only read the documents or can they edit and upload to the bucket?
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 doesn't work with Anon
SupabaseSSupabase / help-and-questions
6mo ago
Realtime RLS not working with anon user
SupabaseSSupabase / help-and-questions
3y ago
Getting data with wrong anon key
SupabaseSSupabase / help-and-questions
13mo ago
API KEY "ANON_KEY " for REPLIT
SupabaseSSupabase / help-and-questions
2mo ago