diff options
author | Björn Schießle <schiessle@owncloud.com> | 2016-04-13 17:31:47 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2016-04-20 17:47:32 +0200 |
commit | e906796f99eaaea26cfbb3055ccc27024470b410 (patch) | |
tree | a2ae2ae3490def33c2bb1359733d94481e067300 /apps | |
parent | 52669d0ea3d687b79a9ee04c6351e6793803ecb4 (diff) | |
download | nextcloud-server-e906796f99eaaea26cfbb3055ccc27024470b410.tar.gz nextcloud-server-e906796f99eaaea26cfbb3055ccc27024470b410.zip |
ask for share-permissions on propfind
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/external/storage.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/external/storage.php b/apps/files_sharing/lib/external/storage.php index 8fe7af66044..4382dcab0c3 100644 --- a/apps/files_sharing/lib/external/storage.php +++ b/apps/files_sharing/lib/external/storage.php @@ -319,5 +319,21 @@ class Storage extends DAV implements ISharedStorage { } return ($this->getPermissions($path) & \OCP\Constants::PERMISSION_SHARE); } + + public function getPermissions($path) { + $response = $this->propfind($path); + if (isset($response['{http://open-collaboration-services.org/ns}share-permissions'])) { + $permissions = $response['{http://open-collaboration-services.org/ns}share-permissions']; + } else { + // use default permission if remote server doesn't provide the share permissions + if ($this->is_dir($path)) { + $permissions = \OCP\Constants::PERMISSION_ALL; + } else { + $permissions = \OCP\Constants::PERMISSION_ALL & ~\OCP\Constants::PERMISSION_CREATE; + } + } + + return $permissions; + } } |