Skip to content

Commit

Permalink
fix ACL rename bug
Browse files Browse the repository at this point in the history
Signed-off-by: Jake Esser <jake@jakes-co.de>

Replaced delete permission check with parent comparison

Use strict comparison

Fixed formatting issue

Signed-off-by: Jake Esser <jake@jakes-co.de>

Formatted code
  • Loading branch information
x7airworker committed Mar 7, 2024
1 parent b58cde4 commit 6f8b431
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/ACL/ACLStorageWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ public function rename($source, $target) {
if ($sourceParent === '.') {
$sourceParent = '';
}
return $this->checkPermissions($sourceParent, Constants::PERMISSION_DELETE) &&
$targetParent = dirname($target);
if ($targetParent === '.') {
$targetParent = '';
}
return ($sourceParent === $targetParent ||
$this->checkPermissions($sourceParent, Constants::PERMISSION_DELETE)) &&
$this->checkPermissions($source, Constants::PERMISSION_UPDATE & Constants::PERMISSION_READ) &&
$this->checkPermissions($target, $permissions) &&
parent::rename($source, $target);
Expand Down

0 comments on commit 6f8b431

Please sign in to comment.