From: Roeland Jago Douma Date: Mon, 26 Apr 2021 12:15:00 +0000 (+0200) Subject: Improve federated permission handling X-Git-Tag: v20.0.10RC1~13^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F26771%2Fhead;p=nextcloud-server.git Improve federated permission handling Signed-off-by: Roeland Jago Douma --- diff --git a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php index f5aef1dbd8e..7408a374601 100644 --- a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php +++ b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php @@ -31,6 +31,7 @@ namespace OCA\FederatedFileSharing\OCM; use OC\AppFramework\Http; use OC\Files\Filesystem; +use OC\HintException; use OCA\FederatedFileSharing\AddressHandler; use OCA\FederatedFileSharing\FederatedShareProvider; use OCA\Files_Sharing\Activity\Providers\RemoteShares; @@ -678,24 +679,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider { * @throws BadRequestException */ protected function updateResharePermissions($id, array $notification) { - if (!isset($notification['sharedSecret'])) { - throw new BadRequestException(['sharedSecret']); - } - $token = $notification['sharedSecret']; - - if (!isset($notification['permission'])) { - throw new BadRequestException(['permission']); - } - $ocmPermissions = $notification['permission']; - - $share = $this->federatedShareProvider->getShareById($id); - - $ncPermission = $this->ocmPermissions2ncPermissions($ocmPermissions); - - $this->verifyShare($share, $token); - $this->updatePermissionsInDatabase($share, $ncPermission); - - return []; + throw new HintException('Updating reshares not allowed'); } /**