Skip to content

Commit

Permalink
[Bug] Fixed permission checks in certain constellations (#798)
Browse files Browse the repository at this point in the history
* fixed permission checks in certain constellations

* fixed style

* fixed permission checks in certain constellations
  • Loading branch information
fashxp authored Dec 17, 2024
1 parent 0b7366e commit 3d0fca2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Helper/GridHelperService.php
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ private function optimizedConcatNotLike(string $fullpath, bool $onlyChildren = f
}

return '(
(`path` != "' . $path . '/" AND `key` != "' . $leaf . '")
NOT (`path` = "' . $path . '/" AND `key` = "' . $leaf . '")
AND
`path` NOT LIKE "' . $fullpath . '/%"
)';
Expand Down Expand Up @@ -989,7 +989,9 @@ protected function getPermittedPathsByUser(string $type, User $user): string
//if any allowed child is found, the current folder can be listed but its content is still blocked
$onlyChildren = true;
}
$forbiddenPathSql[] = $this->optimizedConcatNotLike($forbiddenPath, $onlyChildren) . $exceptions;
$forbiddenPathSql[] =
'(' . $this->optimizedConcatNotLike($forbiddenPath, $onlyChildren) . $exceptions . ')'
;
}
foreach ($elementPaths['allowed'] as $allowedPaths) {
$allowedPathSql[] = $this->optimizedConcatLike($allowedPaths);
Expand Down

0 comments on commit 3d0fca2

Please sign in to comment.