diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-08-27 13:10:32 +0200 |
---|---|---|
committer | Andy Scherzinger <info@andy-scherzinger.de> | 2024-08-28 17:22:20 +0200 |
commit | 030c209d22ea93b2f168bd02521d83c525ea26ab (patch) | |
tree | 5f5369c71abcd9746dccc49b186d5427f016b62a /lib/private/Files/Node | |
parent | 0d41c4991859533b4df89e41368c21437b7464f5 (diff) | |
download | nextcloud-server-030c209d22ea93b2f168bd02521d83c525ea26ab.tar.gz nextcloud-server-030c209d22ea93b2f168bd02521d83c525ea26ab.zip |
fix: Renaming does not need update but delete permissions
Renaming is basically copy + delete (a move), so no need to update permissions.
Especially if the node is in a invalid directory the node should be moveable but not editable.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'lib/private/Files/Node')
-rw-r--r-- | lib/private/Files/Node/Node.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/private/Files/Node/Node.php b/lib/private/Files/Node/Node.php index b49a04e6f62..5dbdc4054bf 100644 --- a/lib/private/Files/Node/Node.php +++ b/lib/private/Files/Node/Node.php @@ -432,11 +432,14 @@ class Node implements INode { $targetPath = $this->normalizePath($targetPath); $parent = $this->root->get(dirname($targetPath)); if ( - $parent instanceof Folder and - $this->isValidPath($targetPath) and - ( - $parent->isCreatable() || - ($parent->getInternalPath() === '' && $parent->getMountPoint() instanceof MoveableMount) + ($parent instanceof Folder) + && $this->isValidPath($targetPath) + && ( + $parent->isCreatable() + || ( + $parent->getInternalPath() === '' + && ($parent->getMountPoint() instanceof MoveableMount) + ) ) ) { $nonExisting = $this->createNonExistingNode($targetPath); |