summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2022-12-22 15:42:42 +0100
committerGitHub <noreply@github.com>2022-12-22 15:42:42 +0100
commit628b0d8fc43249e9116421133eda7ff6be72a706 (patch)
tree7b98d118b8f617b924b07246f0b855353614f483 /apps/files_sharing/lib
parentff2b8ca8f558853fcf679a6c14db7cf8dfc73635 (diff)
parenta7abe2c35a170d60b6860aa929fe9c3c658c4bc8 (diff)
downloadnextcloud-server-628b0d8fc43249e9116421133eda7ff6be72a706.tar.gz
nextcloud-server-628b0d8fc43249e9116421133eda7ff6be72a706.zip
Merge pull request #35213 from PLUTEX/32611-ocs-api-share-permissions
Honor permissions of new link share via OCS API
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index 43f43d10731..ab318a81fc2 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -478,7 +478,14 @@ class ShareAPIController extends OCSController {
$share = $this->shareManager->newShare();
if ($permissions === null) {
- $permissions = (int)$this->config->getAppValue('core', 'shareapi_default_permissions', (string)Constants::PERMISSION_ALL);
+ if ($shareType === IShare::TYPE_LINK
+ || $shareType === IShare::TYPE_EMAIL) {
+
+ // to keep legacy default behaviour, we ignore the setting below for link shares
+ $permissions = Constants::PERMISSION_READ;
+ } else {
+ $permissions = (int)$this->config->getAppValue('core', 'shareapi_default_permissions', (string)Constants::PERMISSION_ALL);
+ }
}
// Verify path
@@ -581,8 +588,6 @@ class ShareAPIController extends OCSController {
Constants::PERMISSION_CREATE |
Constants::PERMISSION_UPDATE |
Constants::PERMISSION_DELETE;
- } else {
- $permissions = Constants::PERMISSION_READ;
}
// TODO: It might make sense to have a dedicated setting to allow/deny converting link shares into federated ones