Skip to content

Commit 655c262

Browse files
authored
Merge pull request #5596 from nextcloud/mount-rename
Fix renaming of non-renamble mounts
2 parents 50fc5a1 + 359a583 commit 655c262

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

core/js/files/client.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,10 @@
331331
case 'C':
332332
case 'K':
333333
data.permissions |= OC.PERMISSION_CREATE;
334-
if (!isFile) {
335-
data.permissions |= OC.PERMISSION_UPDATE;
336-
}
337334
break;
338335
case 'W':
336+
case 'N':
337+
case 'V':
339338
data.permissions |= OC.PERMISSION_UPDATE;
340339
break;
341340
case 'D':

lib/private/Files/View.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -770,14 +770,18 @@ public function rename($path1, $path2) {
770770
$this->changeLock($path1, ILockingProvider::LOCK_EXCLUSIVE, true);
771771
$this->changeLock($path2, ILockingProvider::LOCK_EXCLUSIVE, true);
772772

773-
if ($internalPath1 === '' and $mount1 instanceof MoveableMount) {
774-
if ($this->isTargetAllowed($absolutePath2)) {
775-
/**
776-
* @var \OC\Files\Mount\MountPoint | \OC\Files\Mount\MoveableMount $mount1
777-
*/
778-
$sourceMountPoint = $mount1->getMountPoint();
779-
$result = $mount1->moveMount($absolutePath2);
780-
$manager->moveMount($sourceMountPoint, $mount1->getMountPoint());
773+
if ($internalPath1 === '') {
774+
if ($mount1 instanceof MoveableMount) {
775+
if ($this->isTargetAllowed($absolutePath2)) {
776+
/**
777+
* @var \OC\Files\Mount\MountPoint | \OC\Files\Mount\MoveableMount $mount1
778+
*/
779+
$sourceMountPoint = $mount1->getMountPoint();
780+
$result = $mount1->moveMount($absolutePath2);
781+
$manager->moveMount($sourceMountPoint, $mount1->getMountPoint());
782+
} else {
783+
$result = false;
784+
}
781785
} else {
782786
$result = false;
783787
}

0 commit comments

Comments
 (0)