mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 02:54:03 +00:00
Improve comments
This commit is contained in:
parent
3d6be96f7d
commit
37edba8dbc
1 changed files with 3 additions and 4 deletions
|
|
@ -110,8 +110,6 @@ class TableRLSManager implements RLSPolicyManager
|
||||||
|
|
||||||
protected function generatePaths(string $table, array $foreign, array &$paths, array $currentPath = []): void
|
protected function generatePaths(string $table, array $foreign, array &$paths, array $currentPath = []): void
|
||||||
{
|
{
|
||||||
// If the foreign key has a comment of 'no-rls', we skip it
|
|
||||||
// Also skip the foreign key if implicit scoping is off and the foreign key has no comment
|
|
||||||
if ($this->shouldSkipPathLeadingThrough($foreign)) {
|
if ($this->shouldSkipPathLeadingThrough($foreign)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -137,8 +135,9 @@ class TableRLSManager implements RLSPolicyManager
|
||||||
|
|
||||||
protected function shouldSkipPathLeadingThrough(array $foreignKey): bool
|
protected function shouldSkipPathLeadingThrough(array $foreignKey): bool
|
||||||
{
|
{
|
||||||
// If the foreign key has a comment of 'no-rls', we skip it
|
// If the column has a comment of 'no-rls', we skip it.
|
||||||
// Also skip the foreign key if implicit scoping is off and the foreign key has no comment
|
// Also skip the column if implicit scoping is off and the column
|
||||||
|
// has no 'rls' comment or is not recognized as a comment constraint (its comment doesn't begin with 'rls ').
|
||||||
$pathExplicitlySkipped = $foreignKey['comment'] === 'no-rls';
|
$pathExplicitlySkipped = $foreignKey['comment'] === 'no-rls';
|
||||||
$pathImplicitlySkipped = ! static::$scopeByDefault && (
|
$pathImplicitlySkipped = ! static::$scopeByDefault && (
|
||||||
! isset($foreignKey['comment']) ||
|
! isset($foreignKey['comment']) ||
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue