diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2021-04-19 09:08:32 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2021-04-19 12:17:58 +0200 |
commit | 241dfab33f2703809565365c81b11c9f1c755632 (patch) | |
tree | 76470a567bb710eda6cb6c3f31828c3ae5047dd0 /apps/federatedfilesharing/lib | |
parent | 8c82dd37b4cd023e3a5b8ee492800134e4544f4a (diff) | |
download | nextcloud-server-241dfab33f2703809565365c81b11c9f1c755632.tar.gz nextcloud-server-241dfab33f2703809565365c81b11c9f1c755632.zip |
Do not allow adding file drop shares to your own cloud
There is no reason for this and you can't create such shares normally
anyway.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/federatedfilesharing/lib')
-rw-r--r-- | apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php b/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php index f832fc7e54c..22197988a3b 100644 --- a/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php +++ b/apps/federatedfilesharing/lib/Controller/MountPublicLinkController.php @@ -37,6 +37,7 @@ use OCA\FederatedFileSharing\FederatedShareProvider; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; +use OCP\Constants; use OCP\Federation\ICloudIdManager; use OCP\Http\Client\IClientService; use OCP\IL10N; @@ -157,6 +158,15 @@ class MountPublicLinkController extends Controller { return $response; } + if (($share->getPermissions() & Constants::PERMISSION_READ) === 0) { + $response = new JSONResponse( + ['message' => 'Mounting file drop not supported'], + Http::STATUS_BAD_REQUEST + ); + $response->throttle(); + return $response; + } + $share->setSharedWith($shareWith); $share->setShareType(IShare::TYPE_REMOTE); |