Skip to content

Commit

Permalink
chore: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
soedirgo committed May 31, 2024
1 parent a358590 commit 40daf95
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
10 changes: 8 additions & 2 deletions test/expected/privileged_role.out
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,17 @@ alter role authenticator nologin;
ERROR: "authenticator" is a reserved role, only superusers can modify it
\echo

-- privileged_role cannot manage superuser attribute
-- privileged_role can create nosuperuser
create role r nosuperuser;
drop role r;
\echo

-- privileged_role cannot create superuser or alter [no]superuser
create role r superuser;
ERROR: permission denied to create role
DETAIL: Only roles with the SUPERUSER attribute may create roles with the SUPERUSER attribute.
create role r nosuperuser;
create role r;
alter role r nosuperuser;
alter role r superuser;
ERROR: permission denied to alter role
DETAIL: Only roles with the SUPERUSER attribute may alter roles with the SUPERUSER attribute.
Expand Down
11 changes: 9 additions & 2 deletions test/sql/privileged_role.sql
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,16 @@ alter role authenticator rename to authorized;
alter role authenticator nologin;
\echo

-- privileged_role cannot manage superuser attribute
create role r superuser;
-- privileged_role can create nosuperuser
create role r nosuperuser;

drop role r;
\echo

-- privileged_role cannot create superuser or alter [no]superuser
create role r superuser;
create role r;
alter role r nosuperuser;
alter role r superuser;
alter role postgres nosuperuser;

Expand Down

0 comments on commit 40daf95

Please sign in to comment.