diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-03-05 14:56:31 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2020-04-21 14:35:29 +0200 |
commit | 5646f7c76168b490574fadf9489872efa0dbd808 (patch) | |
tree | e6ceeac44ea8d01da197e9528c4116de3fa34ed1 /apps/files_sharing/lib | |
parent | 45c3ee7f368d0980fca6729c10f62d7234529733 (diff) | |
download | nextcloud-server-5646f7c76168b490574fadf9489872efa0dbd808.tar.gz nextcloud-server-5646f7c76168b490574fadf9489872efa0dbd808.zip |
Link shares have reshare permission if outgoing federated shares are enabled
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 37dc76faaaf..12324daea39 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -492,15 +492,18 @@ class ShareAPIController extends OCSController { throw new OCSNotFoundException($this->l->t('Public upload is only possible for publicly shared folders')); } - $share->setPermissions( - Constants::PERMISSION_READ | + $permissions = Constants::PERMISSION_READ | Constants::PERMISSION_CREATE | Constants::PERMISSION_UPDATE | - Constants::PERMISSION_DELETE - ); + Constants::PERMISSION_DELETE; } else { - $share->setPermissions(Constants::PERMISSION_READ); + $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()) { + $permissions |= Constants::PERMISSION_SHARE; } + $share->setPermissions($permissions); // Set password if ($password !== '') { |