File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -206,3 +206,24 @@ select * from storage.migrations ;
206
206
----+------+------+-------------
207
207
(0 rows)
208
208
209
+ -- postgres can grant storage privileges to custom roles
210
+ create role r;
211
+ grant r to postgres with admin option;
212
+ set role r;
213
+ select * from storage.buckets;
214
+ ERROR: permission denied for schema storage
215
+ LINE 1: select * from storage.buckets;
216
+ ^
217
+ set role postgres;
218
+ grant usage on schema storage to r;
219
+ grant select on storage.buckets to r;
220
+ set role r;
221
+ select * from storage.buckets;
222
+ id | name | owner | created_at | updated_at
223
+ ----+------+-------+------------+------------
224
+ (0 rows)
225
+
226
+ set role postgres;
227
+ drop owned by r cascade;
228
+ drop role r;
229
+ reset role;
Original file line number Diff line number Diff line change @@ -95,3 +95,22 @@ order by
95
95
96
96
-- storage service migrations
97
97
select * from storage .migrations ;
98
+
99
+ -- postgres can grant storage privileges to custom roles
100
+ create role r;
101
+ grant r to postgres with admin option;
102
+
103
+ set role r;
104
+ select * from storage .buckets ;
105
+
106
+ set role postgres;
107
+ grant usage on schema storage to r;
108
+ grant select on storage .buckets to r;
109
+
110
+ set role r;
111
+ select * from storage .buckets ;
112
+
113
+ set role postgres;
114
+ drop owned by r cascade;
115
+ drop role r;
116
+ reset role;
You can’t perform that action at this time.
0 commit comments