Skip to content

Commit 53e9c32

Browse files
committed
fix: Fix permission issue when uploading a chunked file
Follow up from #59511 Signed-off-by: Carl Schwan <carlschwan@kde.org>
1 parent abd693e commit 53e9c32

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

apps/dav/appinfo/v2/publicremote.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* SPDX-License-Identifier: AGPL-3.0-only
77
*/
88
use OC\Files\Filesystem;
9-
use OC\Files\Storage\Wrapper\PermissionsMask;
9+
use OC\Files\Storage\Wrapper\DirPermissionsMask;
1010
use OC\Files\View;
1111
use OCA\DAV\Connector\Sabre\PublicAuth;
1212
use OCA\DAV\Connector\Sabre\ServerFactory;
@@ -113,10 +113,14 @@
113113
// For chunked uploads it is necessary to have read and delete permission,
114114
// so the temporary directory, chunks and destination file can be read and delete after the assembly.
115115
if (str_starts_with(substr($requestUri, strlen($baseuri) - 1), '/uploads/')) {
116-
$mask |= Constants::PERMISSION_READ | Constants::PERMISSION_DELETE;
116+
$mask |= Constants::PERMISSION_READ | Constants::PERMISSION_DELETE | Constants::PERMISSION_UPDATE;
117117
}
118118

119-
return new PermissionsMask(['storage' => $storage, 'mask' => $mask]);
119+
return new DirPermissionsMask([
120+
'storage' => $storage,
121+
'mask' => $mask,
122+
'path' => 'files',
123+
]);
120124
});
121125

122126
/** @psalm-suppress MissingClosureParamType */

0 commit comments

Comments
 (0)