This commit is contained in:
parent
7cb1865183
commit
1600c29f44
|
|
@ -18,11 +18,19 @@ BEGIN
|
|||
END IF;
|
||||
|
||||
-- Install ROLES
|
||||
EXECUTE 'CREATE ROLE ' || anon_role || ' NOLOGIN NOINHERIT';
|
||||
EXECUTE 'CREATE ROLE ' || authenticated_role || ' NOLOGIN NOINHERIT';
|
||||
EXECUTE 'CREATE ROLE ' || service_role || ' NOLOGIN NOINHERIT bypassrls';
|
||||
EXECUTE 'CREATE ROLE IF NOT EXISTS ' || anon_role || ' NOLOGIN NOINHERIT';
|
||||
EXECUTE 'CREATE ROLE IF NOT EXISTS ' || authenticated_role || ' NOLOGIN NOINHERIT';
|
||||
EXECUTE 'CREATE ROLE IF NOT EXISTS ' || service_role || ' NOLOGIN NOINHERIT bypassrls';
|
||||
|
||||
-- create user authenticator noinherit;
|
||||
IF NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM pg_roles
|
||||
WHERE rolname = 'authenticator'
|
||||
) THEN
|
||||
EXECUTE 'create user authenticator noinherit;';
|
||||
END IF;
|
||||
|
||||
create user authenticator noinherit;
|
||||
EXECUTE 'grant ' || anon_role || ' to authenticator';
|
||||
EXECUTE 'grant ' || authenticated_role || ' to authenticator';
|
||||
EXECUTE 'grant ' || service_role || ' to authenticator';
|
||||
|
|
|
|||
Loading…
Reference in New Issue