diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-07-13 14:20:35 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-07-13 14:20:35 +0200 |
commit | b3b080e1c04274fb880ce79c8ee8a8e5d0702989 (patch) | |
tree | 7da865092f0a3c98ab69fdfb8dd1eb7e8f2981ed /lib | |
parent | 1006ec56ceb2c7c5bc14a5401d46767cb4b72e6c (diff) | |
download | nextcloud-server-b3b080e1c04274fb880ce79c8ee8a8e5d0702989.tar.gz nextcloud-server-b3b080e1c04274fb880ce79c8ee8a8e5d0702989.zip |
Strip public webdav info about sharing and mount points
Remove information about whether a file is an incoming share or mount
point when requested over public webdav.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/connector/sabre/filesplugin.php | 18 |
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) { |