classDefaultRevoke
final class DefaultRevoke
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.The REVOKE action of ALTER DEFAULT PRIVILEGES: privileges future objects of a kind no longer receive.
Mirrors the GrantStmt of DefACLAction without is_grant: the privileges (an empty list is ALL PRIVILEGES), the kind of object, the roles, GRANT OPTION FOR and CASCADE or RESTRICT as written. Source: https://www.postgresql.org/docs/17/sql-alterdefaultprivileges.html.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER DEFAULT PRIVILEGES REVOKE GRANT OPTION FOR ALL ON FUNCTIONS FROM joe RESTRICT');
[$operation->statement->action->grantOptionOnly, $operation->statement->action->behavior?->value] // => [true, 'RESTRICT']Properties§
public list<Privilege> $privilegespublic non-empty-list<RoleSpec> $granteespublic DefaultObjectKind $objectspublic bool $grantOptionOnly = falsepublic DropBehavior|null $behavior = nullMethods§
public function __construct(
list<Privilege> $privileges,
public DefaultObjectKind $objects,
list<RoleSpec> $grantees,
public bool $grantOptionOnly = false,
public DropBehavior|null $behavior = null,
)Parameters
$privileges | list<Privilege> | The privileges in the order written; empty for ALL PRIVILEGES |
$objects | DefaultObjectKind | The kind of object the defaults are set for |
$grantees | list<RoleSpec> | The roles the privileges are revoked from, at least one |
$grantOptionOnly | bool | Whether GRANT OPTION FOR is written |
$behavior | DropBehavior|null | CASCADE or RESTRICT, when written |
Calls 4
- method-call PrivilegeLists::privileges() line 52
- new PrivilegeLists line 52
- static-call Check::listOf() line 53
- class-const RoleSpec::class() line 53
public function render(Output $out): voidWrites the action.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 61
- method-call PrivilegeLists::write() line 65
- new PrivilegeLists line 65
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 1
Relations§
Instantiated in 2
- new SqlSemantics\Platform\PostgreSql\Lowering\Access\DefaultPrivilegeRule::action() packages/sql-semantics-postgres/src/Lowering/Access/DefaultPrivilegeRule.php:112
- new SqlSemantics\Platform\PostgreSql\Lowering\Access\DefaultPrivilegeRule::action() packages/sql-semantics-postgres/src/Lowering/Access/DefaultPrivilegeRule.php:113
Type declarations 3
- type SqlSemantics\Platform\PostgreSql\Lowering\Access\DefaultPrivilegeRule packages/sql-semantics-postgres/src/Lowering/Access/DefaultPrivilegeRule.php:104
- type SqlSemantics\Platform\PostgreSql\Rules\Access\DefaultPrivilegeChecks packages/sql-semantics-postgres/src/Rules/Access/DefaultPrivilegeChecks.php:38
- type SqlSemantics\Platform\PostgreSql\Statement\Catalog\Access\Defaults\AlterDefaultPrivileges packages/sql-semantics-postgres/src/Statement/Catalog/Access/Defaults/AlterDefaultPrivileges.php:43