aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-08-27 13:10:32 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-08-28 20:23:50 +0200
commit183fcef39b40608e931f6470ef48182c657bd918 (patch)
tree43ccc3366c8c64c5f8daa6fa94cbf9f9b3d61f91 /lib/private
parente5e3459a5492394c9475a6543492c6e5805eb10b (diff)
downloadnextcloud-server-183fcef39b40608e931f6470ef48182c657bd918.tar.gz
nextcloud-server-183fcef39b40608e931f6470ef48182c657bd918.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')
-rw-r--r--lib/private/Files/Node/Node.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/private/Files/Node/Node.php b/lib/private/Files/Node/Node.php
index e7f533e73a9..f547d87a83e 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);