function Common::canDownloadArchive in Filebrowser 8.2
Same name and namespace in other branches
- 3.x src/Services/Common.php \Drupal\filebrowser\Services\Common::canDownloadArchive()
Check if user can download ZIP archives.
Parameters
NodeInterface $node Node containing the filebrowser:
Return value
bool
1 call to Common::canDownloadArchive()
- Common::userAllowedActions in src/
Services/ Common.php - Returns an array containing the allowed actions for logged in user. Array is used to complete building the form ActionForm.php
File
- src/
Services/ Common.php, line 114
Class
- Common
- Class Common @package Drupal\filebrowser\Services
Namespace
Drupal\filebrowser\ServicesCode
function canDownloadArchive(NodeInterface $node) {
$download_archive = $node->filebrowser->downloadArchive;
return $node
->access('view') && $download_archive && \Drupal::currentUser()
->hasPermission(Common::DOWNLOAD_ARCHIVE);
}