diff --git a/apps/dav/appinfo/v2/publicremote.php b/apps/dav/appinfo/v2/publicremote.php index d1286a577c741..03b8fb21f8519 100644 --- a/apps/dav/appinfo/v2/publicremote.php +++ b/apps/dav/appinfo/v2/publicremote.php @@ -6,7 +6,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ use OC\Files\Filesystem; -use OC\Files\Storage\Wrapper\PermissionsMask; +use OC\Files\Storage\Wrapper\DirPermissionsMask; use OC\Files\View; use OCA\DAV\Connector\Sabre\PublicAuth; use OCA\DAV\Connector\Sabre\ServerFactory; @@ -116,7 +116,11 @@ $mask |= Constants::PERMISSION_READ | Constants::PERMISSION_DELETE; } - return new PermissionsMask(['storage' => $storage, 'mask' => $mask]); + return new DirPermissionsMask([ + 'storage' => $storage, + 'mask' => $mask, + 'path' => 'files', + ]); }); /** @psalm-suppress MissingClosureParamType */ diff --git a/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php b/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php index 14b6441f98b67..7a8ff75f24622 100644 --- a/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php +++ b/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php @@ -88,7 +88,7 @@ public function getPermissions($path): int { } public function rename($source, $target): bool { - if (!$this->isUpdatable($source)) { + if (!($this->isDeletable($source) || $this->isUpdatable($source))) { return false; }