diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-06-04 18:19:52 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-06-04 18:19:52 +0200 |
commit | 9eb177e8bc47de840af01c3b1134c1aa1e57adac (patch) | |
tree | d7d360057fd3a2500e6dec136be8e69feb81cd54 /apps | |
parent | b5f0a179187bb3f10a939518c6eba72593c1f7a5 (diff) | |
download | nextcloud-server-9eb177e8bc47de840af01c3b1134c1aa1e57adac.tar.gz nextcloud-server-9eb177e8bc47de840af01c3b1134c1aa1e57adac.zip |
Use the permissions exposed by ownCloud for webdav external storages
Diffstat (limited to 'apps')
-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 dc98dcfb808..50be934cc99 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); + } + } } |