mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Merge pull request #48401 from nextcloud/backport/48366/stable30
This commit is contained in:
commit
0676a52c1d
1 changed files with 13 additions and 6 deletions
19
apps/files_sharing/lib/External/Storage.php
vendored
19
apps/files_sharing/lib/External/Storage.php
vendored
|
|
@ -357,14 +357,21 @@ class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage,
|
|||
|
||||
public function getPermissions($path): int {
|
||||
$response = $this->propfind($path);
|
||||
if ($response === false) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$ocsPermissions = $response['{http://open-collaboration-services.org/ns}share-permissions'] ?? null;
|
||||
$ocmPermissions = $response['{http://open-cloud-mesh.org/ns}share-permissions'] ?? null;
|
||||
$ocPermissions = $response['{http://owncloud.org/ns}permissions'] ?? null;
|
||||
// old federated sharing permissions
|
||||
if (isset($response['{http://open-collaboration-services.org/ns}share-permissions'])) {
|
||||
$permissions = (int)$response['{http://open-collaboration-services.org/ns}share-permissions'];
|
||||
} elseif (isset($response['{http://open-cloud-mesh.org/ns}share-permissions'])) {
|
||||
if ($ocsPermissions !== null) {
|
||||
$permissions = (int)$ocsPermissions;
|
||||
} elseif ($ocmPermissions !== null) {
|
||||
// permissions provided by the OCM API
|
||||
$permissions = $this->ocmPermissions2ncPermissions($response['{http://open-collaboration-services.org/ns}share-permissions'], $path);
|
||||
} elseif (isset($response['{http://owncloud.org/ns}permissions'])) {
|
||||
return $this->parsePermissions($response['{http://owncloud.org/ns}permissions']);
|
||||
$permissions = $this->ocmPermissions2ncPermissions($ocmPermissions, $path);
|
||||
} elseif ($ocPermissions !== null) {
|
||||
return $this->parsePermissions($ocPermissions);
|
||||
} else {
|
||||
// use default permission if remote server doesn't provide the share permissions
|
||||
$permissions = $this->getDefaultPermissions($path);
|
||||
|
|
|
|||
Loading…
Reference in a new issue