allow renaming the root of a movable mount even if the parent folder is readonly
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
762a8bb3d9
commit
3ca1e90044
|
@ -28,6 +28,7 @@
|
|||
namespace OC\Files\Node;
|
||||
|
||||
use OC\Files\Filesystem;
|
||||
use OC\Files\Mount\MoveableMount;
|
||||
use OCP\Files\FileInfo;
|
||||
use OCP\Files\InvalidPathException;
|
||||
use OCP\Files\NotFoundException;
|
||||
|
@ -415,7 +416,14 @@ class Node implements \OCP\Files\Node {
|
|||
public function move($targetPath) {
|
||||
$targetPath = $this->normalizePath($targetPath);
|
||||
$parent = $this->root->get(dirname($targetPath));
|
||||
if ($parent instanceof Folder and $this->isValidPath($targetPath) and $parent->isCreatable()) {
|
||||
if (
|
||||
$parent instanceof Folder and
|
||||
$this->isValidPath($targetPath) and
|
||||
(
|
||||
$parent->isCreatable() ||
|
||||
($parent->getInternalPath() === '' && $parent->getMountPoint() instanceof MoveableMount)
|
||||
)
|
||||
) {
|
||||
$nonExisting = $this->createNonExistingNode($targetPath);
|
||||
$this->root->emit('\OC\Files', 'preRename', [$this, $nonExisting]);
|
||||
$this->root->emit('\OC\Files', 'preWrite', [$nonExisting]);
|
||||
|
|
Loading…
Reference in New Issue