summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-10-17 12:37:46 +0200
committerCarl Schwan <carl@carlschwan.eu>2022-10-17 12:37:46 +0200
commitc6b8a3bec34e882aa7c19b2d65d18fd7e29009b1 (patch)
tree20566f174ba8b8ab534820447da93120d8bab57a
parent53e408f76aecf20b68b48d373ae000bd7c3f5e88 (diff)
downloadnextcloud-server-c6b8a3bec34e882aa7c19b2d65d18fd7e29009b1.tar.gz
nextcloud-server-c6b8a3bec34e882aa7c19b2d65d18fd7e29009b1.zip
Fix permission not being int
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php2
-rw-r--r--apps/files_sharing/lib/External/Storage.php8
2 files changed, 5 insertions, 5 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index 0a876e98912..ae8559870f3 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -581,7 +581,7 @@ class ShareAPIController extends OCSController {
}
// TODO: It might make sense to have a dedicated setting to allow/deny converting link shares into federated ones
- if (($permissions & Constants::PERMISSION_READ) && $this->shareManager->outgoingServer2ServerSharesAllowed()) {
+ if ($this->shareManager->outgoingServer2ServerSharesAllowed()) {
$permissions |= Constants::PERMISSION_SHARE;
}
diff --git a/apps/files_sharing/lib/External/Storage.php b/apps/files_sharing/lib/External/Storage.php
index 296e7ddf85b..43568ea6a2b 100644
--- a/apps/files_sharing/lib/External/Storage.php
+++ b/apps/files_sharing/lib/External/Storage.php
@@ -355,18 +355,18 @@ class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage,
return $this->cloudId->getDisplayId();
}
- public function isSharable($path) {
+ public function isSharable($path): bool {
if (\OCP\Util::isSharingDisabledForUser() || !\OC\Share\Share::isResharingAllowed()) {
return false;
}
- return ($this->getPermissions($path) & Constants::PERMISSION_SHARE);
+ return (bool)($this->getPermissions($path) & Constants::PERMISSION_SHARE);
}
- public function getPermissions($path) {
+ public function getPermissions($path): int {
$response = $this->propfind($path);
// old federated sharing permissions
if (isset($response['{http://open-collaboration-services.org/ns}share-permissions'])) {
- $permissions = $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'])) {
// permissions provided by the OCM API
$permissions = $this->ocmPermissions2ncPermissions($response['{http://open-collaboration-services.org/ns}share-permissions'], $path);