UPDATE permissions qualify for renaming a node
This commit is contained in:
parent
4c0665b6ec
commit
cf69a2b7eb
|
@ -204,13 +204,18 @@ class ObjectTree extends \Sabre\DAV\Tree {
|
||||||
}
|
}
|
||||||
|
|
||||||
$infoDestination = $this->fileView->getFileInfo(dirname($destinationPath));
|
$infoDestination = $this->fileView->getFileInfo(dirname($destinationPath));
|
||||||
$infoSource = $this->fileView->getFileInfo($sourcePath);
|
if (dirname($destinationPath) === dirname($sourcePath)) {
|
||||||
if ($this->fileView->file_exists($destinationPath)) {
|
$sourcePermission = $infoDestination && $infoDestination->isUpdateable();
|
||||||
$destinationPermission = $infoDestination && $infoDestination->isUpdateable();
|
$destinationPermission = $sourcePermission;
|
||||||
} else {
|
} else {
|
||||||
$destinationPermission = $infoDestination && $infoDestination->isCreatable();
|
$infoSource = $this->fileView->getFileInfo($sourcePath);
|
||||||
|
if ($this->fileView->file_exists($destinationPath)) {
|
||||||
|
$destinationPermission = $infoDestination && $infoDestination->isUpdateable();
|
||||||
|
} else {
|
||||||
|
$destinationPermission = $infoDestination && $infoDestination->isCreatable();
|
||||||
|
}
|
||||||
|
$sourcePermission = $infoSource && $infoSource->isDeletable();
|
||||||
}
|
}
|
||||||
$sourcePermission = $infoSource && $infoSource->isDeletable();
|
|
||||||
|
|
||||||
if (!$destinationPermission || !$sourcePermission) {
|
if (!$destinationPermission || !$sourcePermission) {
|
||||||
throw new Forbidden('No permissions to move object.');
|
throw new Forbidden('No permissions to move object.');
|
||||||
|
|
Loading…
Reference in New Issue