Skip to content

Commit

Permalink
public share link: allow setting permissions on creation, do not alwa…
Browse files Browse the repository at this point in the history
…ys use defaults

Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
  • Loading branch information
Julien Veyssier committed Jul 26, 2022
1 parent 9f77aba commit 0f87e0a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/files_sharing/lib/Controller/ShareAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ public function createShare(
): DataResponse {
$share = $this->shareManager->newShare();

$requestPermissions = $permissions;
if ($permissions === null) {
$permissions = $this->config->getAppValue('core', 'shareapi_default_permissions', Constants::PERMISSION_ALL);
}
Expand Down Expand Up @@ -558,7 +559,10 @@ public function createShare(
Constants::PERMISSION_UPDATE |
Constants::PERMISSION_DELETE;
} else {
$permissions = Constants::PERMISSION_READ;
// do not ignore permissions request param if provided
if ($requestPermissions === null) {
$permissions = Constants::PERMISSION_READ;
}
}

// TODO: It might make sense to have a dedicated setting to allow/deny converting link shares into federated ones
Expand Down

0 comments on commit 0f87e0a

Please sign in to comment.