From 6b05ce612cc85e6b32beb47cfe074db28a833e09 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Wed, 15 Apr 2026 17:21:46 +0200 Subject: [PATCH] fix: Fix permission issue when uploading a chunked file Follow up from #59511 Signed-off-by: Carl Schwan --- apps/dav/appinfo/v2/publicremote.php | 8 ++++++-- lib/private/Files/Storage/Wrapper/DirPermissionsMask.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/dav/appinfo/v2/publicremote.php b/apps/dav/appinfo/v2/publicremote.php index f198f380cc0..3f014f1c65c 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; @@ -111,7 +111,11 @@ $server = $serverFactory->createServer(true, $baseuri, $requestUri, $authPlugin, $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 14b6441f98b..b4d29558f4a 100644 --- a/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php +++ b/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php @@ -88,7 +88,7 @@ class DirPermissionsMask extends PermissionsMask { } public function rename($source, $target): bool { - if (!$this->isUpdatable($source)) { + if (!$this->isDeletable($source)) { return false; }