ask for share-permissions on propfind
This commit is contained in:
parent
52669d0ea3
commit
e906796f99
2 changed files with 18 additions and 1 deletions
16
apps/files_sharing/lib/external/storage.php
vendored
16
apps/files_sharing/lib/external/storage.php
vendored
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -246,7 +246,7 @@ class DAV extends Common {
|
|||
*
|
||||
* @throws NotFound
|
||||
*/
|
||||
private function propfind($path) {
|
||||
protected function propfind($path) {
|
||||
$path = $this->cleanPath($path);
|
||||
$cachedResponse = $this->statCache->get($path);
|
||||
if ($cachedResponse === false) {
|
||||
|
@ -264,6 +264,7 @@ class DAV extends Common {
|
|||
'{DAV:}getcontentlength',
|
||||
'{DAV:}getcontenttype',
|
||||
'{http://owncloud.org/ns}permissions',
|
||||
'{http://open-collaboration-services.org/ns}share-permissions',
|
||||
'{DAV:}resourcetype',
|
||||
'{DAV:}getetag',
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue