Skip to content

Commit

Permalink
fix(ShareApiController): Set hideDownload to inverse of allow downloa…
Browse files Browse the repository at this point in the history
…d attribute

Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
  • Loading branch information
nfebe committed Oct 29, 2024
1 parent 2d5060d commit ed1b327
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/files_sharing/lib/Controller/ShareAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,6 @@ public function createShare(
?string $sendMail = null,
): DataResponse {
$share = $this->shareManager->newShare();

if ($permissions === null) {
if ($shareType === IShare::TYPE_LINK
|| $shareType === IShare::TYPE_EMAIL) {
Expand Down Expand Up @@ -637,6 +636,10 @@ public function createShare(

if ($attributes !== null) {
$share = $this->setShareAttributes($share, $attributes);
if ($shareAttributes = $share->getAttributes()) {
$downloadPermission = (bool) $shareAttributes->getAttribute('permissions', 'download');
$share->setHideDownload(!$downloadPermission);
}
}

// Expire date
Expand Down

0 comments on commit ed1b327

Please sign in to comment.