public static function WebformAccountAccess::checkTemplatesAccess in Webform 8.5
Same name and namespace in other branches
- 6.x src/Access/WebformAccountAccess.php \Drupal\webform\Access\WebformAccountAccess::checkTemplatesAccess()
Check whether the user has 'overview' with 'create' permission.
Parameters
\Drupal\Core\Session\AccountInterface $account: Run access checks for this account.
Return value
\Drupal\Core\Access\AccessResultInterface The access result.
1 string reference to 'WebformAccountAccess::checkTemplatesAccess'
- webform_templates.routing.yml in modules/webform_templates/ webform_templates.routing.yml 
- modules/webform_templates/webform_templates.routing.yml
File
- src/Access/ WebformAccountAccess.php, line 49 
Class
- WebformAccountAccess
- Defines the custom access control handler for the user accounts.
Namespace
Drupal\webform\AccessCode
public static function checkTemplatesAccess(AccountInterface $account) {
  $condition = $account
    ->hasPermission('access webform overview') && ($account
    ->hasPermission('administer webform') || $account
    ->hasPermission('create webform'));
  return AccessResult::allowedIf($condition)
    ->cachePerPermissions();
}