diff options
author | Björn Schießle <schiessle@owncloud.com> | 2014-04-24 18:45:45 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2014-04-24 18:45:45 +0200 |
commit | f520305848be6994a0726d907a0182aa07da0be8 (patch) | |
tree | a5c05f26cf6f9a21dd1bc82abf517634199543e2 /lib/private/connector/sabre/objecttree.php | |
parent | 40257d9736ce0d7bad02bf4a1baa86d9b1fc8f7f (diff) | |
parent | b312d38d38c4e391765beb0aadb6bd2eafd9cb2c (diff) | |
download | nextcloud-server-f520305848be6994a0726d907a0182aa07da0be8.tar.gz nextcloud-server-f520305848be6994a0726d907a0182aa07da0be8.zip |
Merge pull request #8026 from owncloud/remove_shared_folder
remove the "Shared" folder
Diffstat (limited to 'lib/private/connector/sabre/objecttree.php')
-rw-r--r-- | lib/private/connector/sabre/objecttree.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/private/connector/sabre/objecttree.php b/lib/private/connector/sabre/objecttree.php index accf020daa2..2956f608380 100644 --- a/lib/private/connector/sabre/objecttree.php +++ b/lib/private/connector/sabre/objecttree.php @@ -87,16 +87,19 @@ class ObjectTree extends \Sabre_DAV_ObjectTree { list($sourceDir,) = \Sabre_DAV_URLUtil::splitPath($sourcePath); list($destinationDir,) = \Sabre_DAV_URLUtil::splitPath($destinationPath); + $isShareMountPoint = false; + list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath( '/' . \OCP\User::getUser() . '/files/' . $sourcePath); + if ($storage instanceof \OC\Files\Storage\Shared && !$internalPath) { + $isShareMountPoint = true; + } + // check update privileges $fs = $this->getFileView(); - if (!$fs->isUpdatable($sourcePath)) { + if (!$fs->isUpdatable($sourcePath) && !$isShareMountPoint) { throw new \Sabre_DAV_Exception_Forbidden(); } if ($sourceDir !== $destinationDir) { // for a full move we need update privileges on sourcePath and sourceDir as well as destinationDir - if (ltrim($destinationDir, '/') === '' && strtolower($sourceNode->getName()) === 'shared') { - throw new \Sabre_DAV_Exception_Forbidden(); - } if (!$fs->isUpdatable($sourceDir)) { throw new \Sabre_DAV_Exception_Forbidden(); } |