diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-05-19 16:52:03 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-05-19 16:52:03 +0200 |
commit | 95741f3936501e3ad6aeb26f93eeb28f9decc273 (patch) | |
tree | 36991750b64e6a768c54651ca0c923e4f1e4eb25 /lib/private/connector/sabre/filesplugin.php | |
parent | 04e6c12fe220171fc2e3c0f634915e7511cafa92 (diff) | |
parent | e5ee84ca9b7c2b95275fa7ea1100fe8c34a4d695 (diff) | |
download | nextcloud-server-95741f3936501e3ad6aeb26f93eeb28f9decc273.tar.gz nextcloud-server-95741f3936501e3ad6aeb26f93eeb28f9decc273.zip |
Merge pull request #8435 from owncloud/fix-8322-master
Expose permission via WebDAV
Diffstat (limited to 'lib/private/connector/sabre/filesplugin.php')
-rw-r--r-- | lib/private/connector/sabre/filesplugin.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/private/connector/sabre/filesplugin.php b/lib/private/connector/sabre/filesplugin.php index f8495b40524..25d7fd53343 100644 --- a/lib/private/connector/sabre/filesplugin.php +++ b/lib/private/connector/sabre/filesplugin.php @@ -37,6 +37,7 @@ class OC_Connector_Sabre_FilesPlugin extends Sabre_DAV_ServerPlugin $server->xmlNamespaces[self::NS_OWNCLOUD] = 'oc'; $server->protectedProperties[] = '{' . self::NS_OWNCLOUD . '}id'; + $server->protectedProperties[] = '{' . self::NS_OWNCLOUD . '}perm'; $this->server = $server; $this->server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties')); @@ -57,15 +58,24 @@ class OC_Connector_Sabre_FilesPlugin extends Sabre_DAV_ServerPlugin if ($node instanceof OC_Connector_Sabre_Node) { - $fileid_propertyname = '{' . self::NS_OWNCLOUD . '}id'; - if (array_search($fileid_propertyname, $requestedProperties)) { - unset($requestedProperties[array_search($fileid_propertyname, $requestedProperties)]); + $fileIdPropertyName = '{' . self::NS_OWNCLOUD . '}id'; + $permissionsPropertyName = '{' . self::NS_OWNCLOUD . '}permissions'; + if (array_search($fileIdPropertyName, $requestedProperties)) { + unset($requestedProperties[array_search($fileIdPropertyName, $requestedProperties)]); + } + if (array_search($permissionsPropertyName, $requestedProperties)) { + unset($requestedProperties[array_search($permissionsPropertyName, $requestedProperties)]); } /** @var $node OC_Connector_Sabre_Node */ $fileId = $node->getFileId(); if (!is_null($fileId)) { - $returnedProperties[200][$fileid_propertyname] = $fileId; + $returnedProperties[200][$fileIdPropertyName] = $fileId; + } + + $permissions = $node->getDavPermissions(); + if (!is_null($fileId)) { + $returnedProperties[200][$permissionsPropertyName] = $permissions; } } |