aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorKate <26026535+provokateurin@users.noreply.github.com>2024-09-26 20:12:56 +0200
committerGitHub <noreply@github.com>2024-09-26 20:12:56 +0200
commit4f31b032637f1594288a9e01c34e60035bb38f88 (patch)
tree0848410610bfe49226ed6a1d7fe23b5843264ba3 /apps
parent310375e91b1f883947ceed990746639178472b83 (diff)
parent26cf5939ed9a8286899453b367b39d0ff0e83610 (diff)
downloadnextcloud-server-4f31b032637f1594288a9e01c34e60035bb38f88.tar.gz
nextcloud-server-4f31b032637f1594288a9e01c34e60035bb38f88.zip
Merge pull request #48399 from nextcloud/backport/48366/stable28
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/External/Storage.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/apps/files_sharing/lib/External/Storage.php b/apps/files_sharing/lib/External/Storage.php
index 7b64690d53e..3a52604ba8d 100644
--- a/apps/files_sharing/lib/External/Storage.php
+++ b/apps/files_sharing/lib/External/Storage.php
@@ -384,14 +384,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);