mirror of
https://github.com/nextcloud/server.git
synced 2026-02-11 14:54:02 -05:00
Fix permission not being int
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
This commit is contained in:
parent
53e408f76a
commit
c6b8a3bec3
2 changed files with 5 additions and 5 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
8
apps/files_sharing/lib/External/Storage.php
vendored
8
apps/files_sharing/lib/External/Storage.php
vendored
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue