You are here

protected function WebformTemplatesController::isAdmin in Webform 8.5

Same name and namespace in other branches
  1. 6.x modules/webform_templates/src/Controller/WebformTemplatesController.php \Drupal\webform_templates\Controller\WebformTemplatesController::isAdmin()

Is the current user a webform administrator.

Return value

bool TRUE if the current user has 'administer webform' or 'edit any webform' permission.

1 call to WebformTemplatesController::isAdmin()
WebformTemplatesController::getTemplates in modules/webform_templates/src/Controller/WebformTemplatesController.php
Get webform templates.

File

modules/webform_templates/src/Controller/WebformTemplatesController.php, line 295

Class

WebformTemplatesController
Provides route responses for webform templates.

Namespace

Drupal\webform_templates\Controller

Code

protected function isAdmin() {
  return $this->currentUser
    ->hasPermission('administer webform') || $this->currentUser
    ->hasPermission('edit any webform');
}