Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Improve federated permission handling
Signed-off-by: Roeland Jago Douma <[email protected]>
  • Loading branch information
rullzer authored and backportbot[bot] committed Apr 26, 2021
commit 5edb02dccfeceb501824a82ca9d68d26bd74c543
20 changes: 2 additions & 18 deletions apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

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;
Expand Down Expand Up @@ -678,24 +679,7 @@ protected function reshareRequested($id, array $notification) {
* @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');
}

/**
Expand Down