You are here

public function LicenseFileManagerInterface::canDownload in Commerce File 8.2

Gets whether the licensed file can be downloaded.

The logic first checks whether the current user has the permission to bypass the license control or administer licenses, and then check the download limits.

Parameters

\Drupal\commerce_license\Entity\LicenseInterface $license: The license entity.

\Drupal\file\FileInterface $file: The file entity.

\Drupal\Core\Session\AccountInterface|null $account: The user to check for. When omitted, the license owner is used instead.

Return value

bool Whether the given licensed file can be downloaded by the current user.

1 method overrides LicenseFileManagerInterface::canDownload()
LicenseFileManager::canDownload in src/LicenseFileManager.php
Gets whether the licensed file can be downloaded.

File

src/LicenseFileManagerInterface.php, line 29

Class

LicenseFileManagerInterface

Namespace

Drupal\commerce_file

Code

public function canDownload(LicenseInterface $license, FileInterface $file, AccountInterface $account = NULL);