diff --git a/schema/deploy/create_roles.sql b/schema/deploy/create_roles.sql index 1a341b59b..22d6629c5 100644 --- a/schema/deploy/create_roles.sql +++ b/schema/deploy/create_roles.sql @@ -12,7 +12,7 @@ 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 ( @@ -20,7 +20,7 @@ begin 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 ( @@ -28,7 +28,7 @@ begin 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 ( @@ -36,7 +36,7 @@ begin 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 ( @@ -44,9 +44,10 @@ begin 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());