Skip to content

Commit 33a2f5b

Browse files
committed
chore: test privileges of cron schema
1 parent 4c36749 commit 33a2f5b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
11
BEGIN;
2+
-- create cron extension as supabase_admin
23
create extension if not exists pg_cron with schema "extensions";
4+
5+
-- \ir migrations/db/init-scripts/00000000000003-post-setup.sql
6+
grant usage on schema cron to postgres with grant option;
7+
alter default privileges in schema cron grant all on tables to postgres with grant option;
8+
alter default privileges in schema cron grant all on routines to postgres with grant option;
9+
alter default privileges in schema cron grant all on sequences to postgres with grant option;
10+
grant all privileges on all tables in schema cron to postgres with grant option;
11+
grant all privileges on all routines in schema cron to postgres with grant option;
12+
grant all privileges on all sequences in schema cron to postgres with grant option;
13+
14+
-- postgres role should have access
15+
set local role postgres;
16+
select * from cron.job;
17+
18+
-- other roles can be granted access
19+
grant usage on schema cron to authenticated;
20+
grant select on all tables in schema cron to authenticated;
21+
22+
-- authenticated role should have access now
23+
set local role authenticated;
24+
select * from cron.job;
325
ROLLBACK;

0 commit comments

Comments
 (0)