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 0ad4fc127b8e5..7989002496e78 100644 --- a/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php +++ b/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php @@ -94,7 +94,15 @@ public function getPermissions($path): int { #[\Override] public function rename($source, $target): bool { - if (!$this->isUpdatable($source)) { + $isPartialUploadFile = dirname($source) === dirname($target) + && strpos($source, '.ocTransferId') > 0; + + if ( + !($isPartialUploadFile + || $this->isUpdatable($source) + || $this->isDeletable($source) + ) + ) { return false; }