You are here

function Common::canDownloadArchive in Filebrowser 8.2

Same name and namespace in other branches
  1. 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\Services

Code

function canDownloadArchive(NodeInterface $node) {
  $download_archive = $node->filebrowser->downloadArchive;
  return $node
    ->access('view') && $download_archive && \Drupal::currentUser()
    ->hasPermission(Common::DOWNLOAD_ARCHIVE);
}