classMembershipChecks
final class MembershipChecks
Checks the grants and revokes of role membership.
Rule: PG-MEMBERSHIP-CHECK-001. Reported, in the words of the server: a column list on a granted role ("column names cannot be included in
- GRANT/REVOKE ROLE"), a membership option other than
admin,inheritand
set ("unrecognized role option"), and PUBLIC as a granted role, a member or the grantor: PUBLIC is not a role, so no membership involves it. Whether a named role exists is never reported: roles are not declarations a context holds. Termination: one pass over finite lists. Source: https://www.postgresql.org/docs/17/sql-grant.html#SQL-GRANT-DESCRIPTION-ROLES, https://www.postgresql.org/docs/17/sql-revoke.html. Status: Implemented.
Methods§
public function roles(
Derivation $derivation,
list<Privilege> $roles,
list<RoleSpec> $members,
?RoleSpec $grantor,
): voidReports the problems of the granted roles, the members and the grantor.
Parameters
$derivation | Derivation | |
$roles | list<Privilege> | |
$members | list<RoleSpec> | |
$grantor | ?RoleSpec |
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Statement\Catalog\Access\Privilege\GrantRole::deriveStatement() packages/sql-semantics-postgres/src/Statement/Catalog/Access/Privilege/GrantRole.php:71
- method-call SqlSemantics\Platform\PostgreSql\Statement\Catalog\Access\Privilege\RevokeRole::deriveStatement() packages/sql-semantics-postgres/src/Statement/Catalog/Access/Privilege/RevokeRole.php:67
Calls 6
- method-call Derivation::report() line 41
- new AccessProblem line 41
- class-const AccessProblemRule::RoleColumns() line 41
- class-const AccessProblemRule::PublicRole() line 44
- method-call RoleChecks::existing() line 47
- new RoleChecks line 47
public function option(Derivation $derivation, Name $name): voidReports a membership option name the server does not recognize.
Parameters
$derivation | Derivation | |
$name | Name |
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Statement\Catalog\Access\Privilege\GrantRole::deriveStatement() packages/sql-semantics-postgres/src/Statement/Catalog/Access/Privilege/GrantRole.php:74
- method-call SqlSemantics\Platform\PostgreSql\Statement\Catalog\Access\Privilege\RevokeRole::deriveStatement() packages/sql-semantics-postgres/src/Statement/Catalog/Access/Privilege/RevokeRole.php:69
Calls 3
- method-call Derivation::report() line 55
- new AccessProblem line 55
- class-const AccessProblemRule::UnrecognizedRoleOption() line 55
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
MembershipChecksTestcalls
Relations§
Instantiated in 2
- new SqlSemantics\Platform\PostgreSql\Statement\Catalog\Access\Privilege\GrantRole::deriveStatement() packages/sql-semantics-postgres/src/Statement/Catalog/Access/Privilege/GrantRole.php:70
- new SqlSemantics\Platform\PostgreSql\Statement\Catalog\Access\Privilege\RevokeRole::deriveStatement() packages/sql-semantics-postgres/src/Statement/Catalog/Access/Privilege/RevokeRole.php:66
Method calls 4
- method-call SqlSemantics\Platform\PostgreSql\Statement\Catalog\Access\Privilege\GrantRole::deriveStatement() packages/sql-semantics-postgres/src/Statement/Catalog/Access/Privilege/GrantRole.php:71
- method-call SqlSemantics\Platform\PostgreSql\Statement\Catalog\Access\Privilege\GrantRole::deriveStatement() packages/sql-semantics-postgres/src/Statement/Catalog/Access/Privilege/GrantRole.php:74
- method-call SqlSemantics\Platform\PostgreSql\Statement\Catalog\Access\Privilege\RevokeRole::deriveStatement() packages/sql-semantics-postgres/src/Statement/Catalog/Access/Privilege/RevokeRole.php:67
- method-call SqlSemantics\Platform\PostgreSql\Statement\Catalog\Access\Privilege\RevokeRole::deriveStatement() packages/sql-semantics-postgres/src/Statement/Catalog/Access/Privilege/RevokeRole.php:69