Skip to content

Commit

Permalink
chore: role admins to cif
Browse files Browse the repository at this point in the history
  • Loading branch information
pbastia committed Dec 17, 2024
1 parent 800a85c commit 6df67e2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions schema/deploy/create_roles.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,42 @@ begin
from pg_catalog.pg_roles
where rolname = 'cif_internal') then

create role cif_internal with admin current_user;
create role cif_internal with admin cif;
end if;

if not exists (
select true
from pg_catalog.pg_roles
where rolname = 'cif_external') then

create role cif_external with admin current_user;
create role cif_external with admin cif;
end if;

if not exists (
select true
from pg_catalog.pg_roles
where rolname = 'cif_admin') then

create role cif_admin with admin current_user;
create role cif_admin with admin cif;
end if;

if not exists (
select true
from pg_catalog.pg_roles
where rolname = 'cif_guest') then

create role cif_guest with admin current_user;
create role cif_guest with admin cif;
end if;

if not exists (
select true
from pg_catalog.pg_roles
where rolname = 'cifapp') then

create user cifapp with admin current_user;
create user cifapp with admin cif;
end if;


grant cif_admin, cif_internal, cif_external, cif_guest to cifapp;
execute format('grant create, connect on database %I to cifapp', current_database());

Expand Down

0 comments on commit 6df67e2

Please sign in to comment.