]> source.dussan.org Git - nextcloud-server.git/commitdiff
Improve federated permission handling 26771/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Mon, 26 Apr 2021 12:15:00 +0000 (14:15 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Mon, 26 Apr 2021 15:27:05 +0000 (15:27 +0000)
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php

index f5aef1dbd8e1b1ad27c70ebec6ae9087796d44ba..7408a374601b6fa153a1f6caef060c515f6b12ac 100644 (file)
@@ -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');
        }
 
        /**