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

Fix permissions check when moving a file to a different directory over webdav
This commit is contained in:
icewind1991 2014-06-25 15:09:58 +02:00
commit 16396e2e33
2 changed files with 5 additions and 4 deletions

View File

@ -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) {

View File

@ -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];
}