From 43ee64495de43a2c5db6b5c656838087b93dc28a Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 8 Jun 2026 12:07:25 +0200 Subject: [PATCH] fix: use correct permissions mark for non-home storage public links Signed-off-by: Robin Appelman --- apps/dav/appinfo/v2/publicremote.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/dav/appinfo/v2/publicremote.php b/apps/dav/appinfo/v2/publicremote.php index 22f1fdd4908..027314e6edc 100644 --- a/apps/dav/appinfo/v2/publicremote.php +++ b/apps/dav/appinfo/v2/publicremote.php @@ -7,6 +7,7 @@ */ use OC\Files\Filesystem; use OC\Files\Storage\Wrapper\DirPermissionsMask; +use OC\Files\Storage\Wrapper\PermissionsMask; use OC\Files\View; use OCA\DAV\Connector\Sabre\PublicAuth; use OCA\DAV\Connector\Sabre\ServerFactory; @@ -21,6 +22,7 @@ use OCP\App\IAppManager; use OCP\BeforeSabrePubliclyLoadedEvent; use OCP\Constants; use OCP\EventDispatcher\IEventDispatcher; +use OCP\Files\IHomeStorage; use OCP\Files\IRootFolder; use OCP\Files\Mount\IMountManager; use OCP\ICacheFactory; @@ -115,11 +117,15 @@ $server = $serverFactory->createServer(true, $baseuri, $requestUri, $authPlugin, $mask |= Constants::PERMISSION_READ | Constants::PERMISSION_DELETE; } - return new DirPermissionsMask([ - 'storage' => $storage, - 'mask' => $mask, - 'path' => 'files', - ]); + if ($storage instanceof IHomeStorage) { + return new DirPermissionsMask([ + 'storage' => $storage, + 'mask' => $mask, + 'path' => 'files', + ]); + } else { + return new PermissionsMask(['storage' => $storage, 'mask' => $mask]); + } }); /** @psalm-suppress MissingClosureParamType */