diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-06-05 11:38:02 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-06-05 11:38:02 +0200 |
commit | d0eb8f8668189d5fe82c9d783f30564d643ba604 (patch) | |
tree | 074f2d6b075e4e5e4c3a5e0efe50802799c3374d /apps/files_external | |
parent | fdfba1440580043ef96e77f8c5abdf5df7cfe301 (diff) | |
parent | 9eb177e8bc47de840af01c3b1134c1aa1e57adac (diff) | |
download | nextcloud-server-d0eb8f8668189d5fe82c9d783f30564d643ba604.tar.gz nextcloud-server-d0eb8f8668189d5fe82c9d783f30564d643ba604.zip |
Merge pull request #8880 from owncloud/webdav-read-permissions
Use the permissions exposed by ownCloud for webdav external storages
Diffstat (limited to 'apps/files_external')
-rw-r--r-- | apps/files_external/lib/webdav.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php index 3ea2db0656d..525f41c1276 100644 --- a/apps/files_external/lib/webdav.php +++ b/apps/files_external/lib/webdav.php @@ -396,5 +396,29 @@ class DAV extends \OC\Files\Storage\Common { return array('curl'); } } + + public function getPermissions($path) { + $this->init(); + $response = $this->client->propfind($this->encodePath($path), array('{http://owncloud.org/ns}permissions')); + if (isset($response['{http://owncloud.org/ns}permissions'])) { + $permissions = 0; + $permissionsString = $response['{http://owncloud.org/ns}permissions']; + if (strpos($permissionsString, 'R') !== false) { + $permissions |= \OCP\PERMISSION_SHARE; + } + if (strpos($permissionsString, 'D') !== false) { + $permissions |= \OCP\PERMISSION_DELETE; + } + if (strpos($permissionsString, 'W') !== false) { + $permissions |= \OCP\PERMISSION_UPDATE; + } + if (strpos($permissionsString, 'C') !== false) { + $permissions |= \OCP\PERMISSION_CREATE; + } + return $permissions; + } else { + return parent::getPermissions($path); + } + } } |