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

If the download attribute is set to false, then we should set hideDownload to
true (essentially hiding the download button from the UI) and vice versa

Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
  • Loading branch information
nfebe committed Oct 29, 2024
1 parent 2d5060d commit d9aa278
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/files_sharing/lib/Controller/ShareAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,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 d9aa278

Please sign in to comment.