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