From e749891b3f6124b37c6af54b968ee625b2849366 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Tue, 24 Jun 2025 15:20:07 +0200 Subject: [PATCH] fix(ACL): Don't check ACL permissions if user doesn't have access to the folder in the first place Signed-off-by: provokateurin --- lib/Command/ACL.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Command/ACL.php b/lib/Command/ACL.php index 554893f0a..06fad5dad 100644 --- a/lib/Command/ACL.php +++ b/lib/Command/ACL.php @@ -76,7 +76,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int $jailPath = $this->mountProvider->getJailPath((int)$folder['id']); $path = $input->getArgument('path'); $aclManager = $this->aclManagerFactory->getACLManager($user); - $permissions = $aclManager->getACLPermissionsForPath($jailPath . rtrim('/' . $path, '/')); + if ($this->folderManager->getFolderPermissionsForUser($user, $folder['id']) === 0) { + $permissions = 0; + } else { + $permissions = $aclManager->getACLPermissionsForPath($jailPath . rtrim('/' . $path, '/')); + } $permissionString = Rule::formatRulePermissions(Constants::PERMISSION_ALL, $permissions); $output->writeln($permissionString);