summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/connector/sabre
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-03-31 21:25:23 +0200
committerRoeland Jago Douma <rullzer@owncloud.com>2016-03-31 21:25:23 +0200
commit89478a0961c70f2b8f55b6ded9103b2cac4223a1 (patch)
treefcff9274cb5d974b9c67ba74bf9253e450432008 /apps/dav/lib/connector/sabre
parent5334bcce6683efc2297b742517c98716dd9d3e43 (diff)
downloadnextcloud-server-89478a0961c70f2b8f55b6ded9103b2cac4223a1.tar.gz
nextcloud-server-89478a0961c70f2b8f55b6ded9103b2cac4223a1.zip
Fix unit tests
Diffstat (limited to 'apps/dav/lib/connector/sabre')
-rw-r--r--apps/dav/lib/connector/sabre/node.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/dav/lib/connector/sabre/node.php b/apps/dav/lib/connector/sabre/node.php
index 4828cb611ed..9867fe66cd3 100644
--- a/apps/dav/lib/connector/sabre/node.php
+++ b/apps/dav/lib/connector/sabre/node.php
@@ -30,6 +30,7 @@
namespace OCA\DAV\Connector\Sabre;
+use OC\Files\Mount\MoveableMount;
use OCA\DAV\Connector\Sabre\Exception\InvalidPath;
@@ -234,7 +235,14 @@ abstract class Node implements \Sabre\DAV\INode {
*/
$mountpoint = $this->info->getMountPoint();
if (!($mountpoint instanceof MoveableMount)) {
- $permissions |= \OCP\Constants::PERMISSION_DELETE | \OCP\Constants::PERMISSION_UPDATE;
+ $mountpointpath = $mountpoint->getMountPoint();
+ if (substr($mountpointpath, -1) === '/') {
+ $mountpointpath = substr($mountpointpath, 0, -1);
+ }
+
+ if ($mountpointpath === $this->info->getPath()) {
+ $permissions |= \OCP\Constants::PERMISSION_DELETE | \OCP\Constants::PERMISSION_UPDATE;
+ }
}
/*