diff options
Diffstat (limited to 'apps/files_sharing/lib/ViewOnly.php')
-rw-r--r-- | apps/files_sharing/lib/ViewOnly.php | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/apps/files_sharing/lib/ViewOnly.php b/apps/files_sharing/lib/ViewOnly.php index 9cd18f968f6..2204d26388b 100644 --- a/apps/files_sharing/lib/ViewOnly.php +++ b/apps/files_sharing/lib/ViewOnly.php @@ -89,17 +89,10 @@ class ViewOnly { /** @var SharedStorage $storage */ $share = $storage->getShare(); - $canDownload = true; - - // Check if read-only and on whether permission can download is both set and disabled. + // Check whether download-permission was denied (granted if not set) $attributes = $share->getAttributes(); - if ($attributes !== null) { - $canDownload = $attributes->getAttribute('permissions', 'download'); - } + $canDownload = $attributes?->getAttribute('permissions', 'download'); - if ($canDownload !== null && !$canDownload) { - return false; - } - return true; + return $canDownload !== false; } } |