|
|
|
|
@ -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); |
|
|
|
|
|