classPolicyRule
final class PolicyRule
Lowers row security policies.
Rule: PG-POLICY-LOWER-001. Scope: CreatePolicyStmt, AlterPolicyStmt, RowSecurityOptionalExpr, RowSecurityOptionalWithCheck, RowSecurityDefaultToRole, RowSecurityOptionalToRole, RowSecurityDefaultPermissive, RowSecurityDefaultForCmd, row_security_cmd. Termination: no recursion of its own. Source: https://www.postgresql.org/docs/17/sql-createpolicy.html. Status: Implemented.
Methods§
public function create(Node $statement): CreatePolicyLowers CreatePolicyStmt.
The word after AS is an identifier that the grammar action of RowSecurityDefaultPermissive in gram.y compares with permissive and restrictive; any other word is a syntax error there.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When the production has no ruleAnalysisException When the word after AS is neither permissive nor restrictiveTest cases 2
Called from 1
Calls 9
- static-call ImplementationGap::production() line 62
- function-call
in_arrayline 65 - method-call Identifiers::decode() line 65
- new Identifiers line 65
- new AnalysisException line 66
- new CreatePolicy line 70
- method-call PolicyRule::command() line 79
- method-call PolicyRule::roles() line 83
- method-call PolicyRule::expression() line 84
public function alter(Node $statement): AlterPolicyLowers AlterPolicyStmt.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 4
- static-call ImplementationGap::production() line 98
- new AlterPolicy line 101
- method-call PolicyRule::roles() line 104
- method-call PolicyRule::expression() line 105
public function command(Node $command): PolicyCommandLowers row_security_cmd.
Parameters
$command | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 2
- class-const PolicyRule::COMMANDS() line 119
- static-call ImplementationGap::production() line 119
Lowers RowSecurityDefaultToRole or RowSecurityOptionalToRole.
Parameters
$clause | Node |
Returns
list<RoleSpec>Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 2
Calls 1
- static-call ImplementationGap::production() line 136
Lowers RowSecurityOptionalExpr or RowSecurityOptionalWithCheck; none is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 4
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\PolicyRule::create() packages/sql-semantics-postgres/src/Lowering/Table/PolicyRule.php:84
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\PolicyRule::create() packages/sql-semantics-postgres/src/Lowering/Table/PolicyRule.php:85
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\PolicyRule::alter() packages/sql-semantics-postgres/src/Lowering/Table/PolicyRule.php:105
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\PolicyRule::alter() packages/sql-semantics-postgres/src/Lowering/Table/PolicyRule.php:106
Calls 1
- static-call ImplementationGap::production() line 153
Private surface 2§
Implementation details, listed for orientation only.
private const COMMANDS = ['row_security_cmd: ALL' => \SqlSemantics\Platform\PostgreSql\Statement\Table\P…private Lowering $loweringTest cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.