diff options
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 11 |
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 |