class GeneratePdfAccessCheck in PDF using mPDF 8.2
Class GeneratePdfAccessCheck @package Drupal\pdf_using_mpdf\Access
Hierarchy
- class \Drupal\pdf_using_mpdf\Access\GeneratePdfAccessCheck implements AccessInterface
Expanded class hierarchy of GeneratePdfAccessCheck
1 string reference to 'GeneratePdfAccessCheck'
1 service uses GeneratePdfAccessCheck
File
- src/
Access/ GeneratePdfAccessCheck.php, line 16
Namespace
Drupal\pdf_using_mpdf\AccessView source
class GeneratePdfAccessCheck implements AccessInterface {
/**
* @param AccountInterface $account
* @param Node|NULL $node
*
* @return AccessResultAllowed|AccessResultForbidden
*/
public function access(AccountInterface $account, Node $node = NULL) {
$permission = 'generate ' . $node
->getType() . ' pdf';
return $account
->hasPermission($permission) ? AccessResult::allowed() : AccessResult::forbidden();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GeneratePdfAccessCheck:: |
public | function |