1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-04 23:14:05 +00:00

Improve comments

This commit is contained in:
lukinovec 2025-05-21 14:10:35 +02:00
parent 3d6be96f7d
commit 37edba8dbc

View file

@ -110,8 +110,6 @@ class TableRLSManager implements RLSPolicyManager
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)) {
return;
}
@ -137,8 +135,9 @@ class TableRLSManager implements RLSPolicyManager
protected function shouldSkipPathLeadingThrough(array $foreignKey): bool
{
// 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 the column has a comment of 'no-rls', we skip it.
// 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';
$pathImplicitlySkipped = ! static::$scopeByDefault && (
! isset($foreignKey['comment']) ||