From: Roeland Jago Douma Date: Wed, 6 May 2020 19:39:49 +0000 (+0200) Subject: Have share permissions on link shares if it is enabled X-Git-Tag: v17.0.7RC1~1^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b48df49b041951fc27d29325719ed058c3a04dd4;p=nextcloud-server.git Have share permissions on link shares if it is enabled Signed-off-by: Roeland Jago Douma --- diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 299744d6dff..f8847125a29 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -477,10 +477,12 @@ class ShareAPIController extends OCSController { } else { $permissions = Constants::PERMISSION_READ; } + // TODO: It might make sense to have a dedicated setting to allow/deny converting link shares into federated ones - if ($this->shareManager->outgoingServer2ServerSharesAllowed()) { + if (($permissions & Constants::PERMISSION_READ) && $this->shareManager->outgoingServer2ServerSharesAllowed()) { $permissions |= Constants::PERMISSION_SHARE; } + $share->setPermissions($permissions); // Set password @@ -906,6 +908,11 @@ class ShareAPIController extends OCSController { } if ($newPermissions !== null) { + // TODO: It might make sense to have a dedicated setting to allow/deny converting link shares into federated ones + if (($newPermissions & Constants::PERMISSION_READ) && $this->shareManager->outgoingServer2ServerSharesAllowed()) { + $newPermissions |= Constants::PERMISSION_SHARE; + } + $share->setPermissions($newPermissions); $permissions = $newPermissions; }