Merge pull request #9123 from owncloud/webdav-move-permissions

Fix permissions check when moving a file to a different directory over webdav
remotes/origin/ldap_group_count
icewind1991 11 years ago
commit 16396e2e33
  1. 5
      lib/private/connector/sabre/objecttree.php
  2. 4
      tests/lib/connector/sabre/objecttree.php

@ -135,10 +135,7 @@ class ObjectTree extends \Sabre\DAV\ObjectTree {
throw new \Sabre\DAV\Exception\Forbidden();
}
if ($sourceDir !== $destinationDir) {
if (!$this->fileView->isUpdatable($sourceDir)) {
throw new \Sabre\DAV\Exception\Forbidden();
}
if (!$this->fileView->isUpdatable($destinationDir)) {
if (!$this->fileView->isCreatable($destinationDir)) {
throw new \Sabre\DAV\Exception\Forbidden();
}
if (!$this->fileView->isDeletable($sourcePath) && !$isMovableMount) {

@ -25,6 +25,10 @@ class TestDoubleFileView extends \OC\Files\View{
return $this->updatables[$path];
}
public function isCreatable($path) {
return $this->updatables[$path];
}
public function isDeletable($path) {
return $this->deletables[$path];
}

Loading…
Cancel
Save