fix: use correct permissions mark for non-home storage public links

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2026-06-08 12:07:25 +02:00
parent e01a54c53a
commit 43ee64495d

View file

@ -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 */