diff --git a/lib/Folder/FolderManager.php b/lib/Folder/FolderManager.php index f9efbb1bf..dbe2b95bd 100644 --- a/lib/Folder/FolderManager.php +++ b/lib/Folder/FolderManager.php @@ -463,9 +463,9 @@ private function getCircles(int $id): array { * * @throws Exception */ - public function canManageACL(int $folderId, IUser $user): bool { + public function canManageACL(int $folderId, IUser $user, bool $excludeAdmins = false): bool { $userId = $user->getUId(); - if ($this->groupManager->isAdmin($userId)) { + if (!$excludeAdmins && $this->groupManager->isAdmin($userId)) { return true; } diff --git a/lib/Trash/TrashBackend.php b/lib/Trash/TrashBackend.php index c52399572..e85d9113d 100644 --- a/lib/Trash/TrashBackend.php +++ b/lib/Trash/TrashBackend.php @@ -443,7 +443,7 @@ private function getTrashForFolders(IUser $user, array $folders): array { // we apply acl filtering later to get the correct permissions again $trashFolder = $this->setupTrashFolder($folder); $content = $trashFolder->getDirectoryListing(); - $userCanManageAcl = $this->folderManager->canManageACL($folder->id, $user); + $userCanManageAcl = $this->folderManager->canManageACL($folder->id, $user, true); $this->aclManagerFactory->getACLManager($user)->preloadRulesForFolder($folder->storageId, $trashFolder->getId()); $itemsForFolder = array_map(function (Node $item) use ($user, $folder, $indexedRows) {