diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2021-04-26 14:15:00 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2021-04-26 16:10:44 +0200 |
commit | 70f12e7332e341c259a4ca94502f743c9c021570 (patch) | |
tree | 9a545c353e70542a60ee3e0909b1f5bc2d5d11f8 | |
parent | aa651fd629534e96432492c1a74e979b28222ce2 (diff) | |
download | nextcloud-server-70f12e7332e341c259a4ca94502f743c9c021570.tar.gz nextcloud-server-70f12e7332e341c259a4ca94502f743c9c021570.zip |
Improve federated permission handling
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r-- | apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php index 63877f3307c..e21ce633dd2 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'); } /** |