mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 01:34:03 +00:00
Fix code style (php-cs-fixer)
This commit is contained in:
parent
55bc56356f
commit
7a6f2ffda6
2 changed files with 4 additions and 4 deletions
|
|
@ -108,9 +108,9 @@ class CreateUserWithRLSPolicies extends Command
|
||||||
foreach ($rlsQueries as $table => $queries) {
|
foreach ($rlsQueries as $table => $queries) {
|
||||||
foreach ($queries as $type => $query) {
|
foreach ($queries as $type => $query) {
|
||||||
[$hash, $policyQuery] = $this->hashPolicy($query);
|
[$hash, $policyQuery] = $this->hashPolicy($query);
|
||||||
$expectedName = $table .'_'.$type.'_rls_policy_' . $hash;
|
$expectedName = $table . '_' . $type . '_rls_policy_' . $hash;
|
||||||
|
|
||||||
$tableRLSPolicy = $this->findTableRLSPolicy($table,$type);
|
$tableRLSPolicy = $this->findTableRLSPolicy($table, $type);
|
||||||
$olderPolicyExists = $tableRLSPolicy && $tableRLSPolicy->policyname !== $expectedName;
|
$olderPolicyExists = $tableRLSPolicy && $tableRLSPolicy->policyname !== $expectedName;
|
||||||
|
|
||||||
// Drop the policy if an outdated version exists
|
// Drop the policy if an outdated version exists
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,9 @@ class TableRLSManager implements RLSPolicyManager
|
||||||
$centralUserName = $this->database->getConfig('username');
|
$centralUserName = $this->database->getConfig('username');
|
||||||
|
|
||||||
foreach ($trees ?: $this->shortestPaths() as $table => $path) {
|
foreach ($trees ?: $this->shortestPaths() as $table => $path) {
|
||||||
$queries[$table] =[
|
$queries[$table] = [
|
||||||
'tenant' => $this->generateQuery($table, $path),
|
'tenant' => $this->generateQuery($table, $path),
|
||||||
'central' => "CREATE POLICY {$table}_central_rls_policy ON {$table} AS PERMISSIVE TO {$centralUserName} USING (true);"
|
'central' => "CREATE POLICY {$table}_central_rls_policy ON {$table} AS PERMISSIVE TO {$centralUserName} USING (true);",
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue