aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-07-13 17:21:40 +0200
committerVincent Petry <pvince81@owncloud.com>2015-07-13 17:21:40 +0200
commite4ed99572756dec2634ca0d18b0b78e97bb613ef (patch)
tree5ca797e11f5e2cac1af41309c896f849d0824c21 /lib
parent08faf1811bd8dd80b634048d29e1eebcaa94d200 (diff)
parentb3b080e1c04274fb880ce79c8ee8a8e5d0702989 (diff)
downloadnextcloud-server-e4ed99572756dec2634ca0d18b0b78e97bb613ef.tar.gz
nextcloud-server-e4ed99572756dec2634ca0d18b0b78e97bb613ef.zip
Merge pull request #17605 from owncloud/pwebdav-stripmountinfo
Strip public webdav info about sharing and mount points
Diffstat (limited to 'lib')
-rw-r--r--lib/private/connector/sabre/filesplugin.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/private/connector/sabre/filesplugin.php b/lib/private/connector/sabre/filesplugin.php
index 608e8cd9017..84620f454aa 100644
--- a/lib/private/connector/sabre/filesplugin.php
+++ b/lib/private/connector/sabre/filesplugin.php
@@ -56,10 +56,19 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin {
private $tree;
/**
+ * Whether this is public webdav.
+ * If true, some returned information will be stripped off.
+ *
+ * @var bool
+ */
+ private $isPublic;
+
+ /**
* @param \Sabre\DAV\Tree $tree
*/
- public function __construct(\Sabre\DAV\Tree $tree) {
+ public function __construct(\Sabre\DAV\Tree $tree, $isPublic = false) {
$this->tree = $tree;
+ $this->isPublic = $isPublic;
}
/**
@@ -129,7 +138,12 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin {
});
$propFind->handle(self::PERMISSIONS_PROPERTYNAME, function() use ($node) {
- return $node->getDavPermissions();
+ $perms = $node->getDavPermissions();
+ if ($this->isPublic) {
+ // remove mount information
+ $perms = str_replace(['S', 'M'], '', $perms);
+ }
+ return $perms;
});
$propFind->handle(self::GETETAG_PROPERTYNAME, function() use ($node) {