Skip to content

Commit 3c0f1f5

Browse files
committed
fix: backport missing grants on buckets & objects
1 parent 5c8643b commit 3c0f1f5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
do $$
2+
declare
3+
super_user text = coalesce(current_setting('storage.super_user', true), 'postgres');
4+
begin
5+
execute 'grant all on storage.buckets, storage.objects to ' || super_user || ' with grant option';
6+
end $$;
7+
8+
do $$
9+
declare
10+
anon_role text = coalesce(current_setting('storage.anon_role', true), 'anon');
11+
authenticated_role text = coalesce(current_setting('storage.authenticated_role', true), 'authenticated');
12+
service_role text = coalesce(current_setting('storage.service_role', true), 'service_role');
13+
begin
14+
execute 'grant all on storage.buckets, storage.objects to ' || service_role || ', ' || authenticated_role || ', ' || anon_role;
15+
end $$;

0 commit comments

Comments
 (0)