You are here

public function GeneratePdf::checkAccess in PDF using mPDF 8

Checks if current user has access to view PDF.

Parameters

\Drupal\Core\Session\AccountInterface $account: Current user account.

Return value

\Drupal\Core\Access\AccessResult True if user has access, false otherwise.

1 string reference to 'GeneratePdf::checkAccess'
pdf_using_mpdf.routing.yml in ./pdf_using_mpdf.routing.yml
pdf_using_mpdf.routing.yml

File

src/Controller/GeneratePdf.php, line 96

Class

GeneratePdf
Class GeneratePdf.

Namespace

Drupal\pdf_using_mpdf\Controller

Code

public function checkAccess(AccountInterface $account) {
  return AccessResult::allowedIf($account
    ->hasPermission('generate pdf using mpdf') && $this
    ->checkContentTypeEnabled());
}