diff options
author | Björn Schießle <schiessle@owncloud.com> | 2016-04-22 14:50:42 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2016-04-22 14:50:42 +0200 |
commit | 606b756a94643eaae87e18b39f6c75e6d18fec7e (patch) | |
tree | 6128dd0ed676164bbfb8a4aa10a56cc511728edd /apps/files_sharing/lib | |
parent | cc4efc4c03f4d4f7ec9e6cf9beac570254bef3c1 (diff) | |
parent | 2a6a336e873db394e9912de20478645f3e4b8fc4 (diff) | |
download | nextcloud-server-606b756a94643eaae87e18b39f6c75e6d18fec7e.tar.gz nextcloud-server-606b756a94643eaae87e18b39f6c75e6d18fec7e.zip |
Merge pull request #23918 from owncloud/cruds-for-federated-shares
bring back CRUDS permissions for federated shares
Diffstat (limited to 'apps/files_sharing/lib')
-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; + } } |