Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions apps/dav/appinfo/v2/publicremote.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/Storage/Wrapper/DirPermissionsMask.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function getPermissions($path): int {
}

public function rename($source, $target): bool {
if (!$this->isUpdatable($source)) {
if (!$this->isDeletable($source)) {
Copy link
Copy Markdown
Member

@icewind1991 icewind1991 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is not correct, see #57374 for some details around rename permissions

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!$this->isDeletable($source)) {
if (!($this->isDeletable($source) || $this->isUpdatable($source))) {

Would this work?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or we can add Constants::PERMISSION_UPDATABLE in apps/dav/appinfo/v2/publicremote.php

return false;
}

Expand Down
Loading