You are here

public static function WebformTwigExtension::hasEditTwigAccess in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Twig/WebformTwigExtension.php \Drupal\webform\Twig\WebformTwigExtension::hasEditTwigAccess()

Determine if the current user can edit Twig templates.

Return value

bool TRUE if the current user can edit Twig templates.

3 calls to WebformTwigExtension::hasEditTwigAccess()
EmailWebformHandler::buildConfigurationForm in src/Plugin/WebformHandler/EmailWebformHandler.php
Form constructor.
WebformCodeMirror::processWebformCodeMirror in src/Element/WebformCodeMirror.php
Processes a 'webform_codemirror' element.
WebformElementBase::form in src/Plugin/WebformElementBase.php
Gets the actual configuration webform array to be built.

File

src/Twig/WebformTwigExtension.php, line 322

Class

WebformTwigExtension
Twig extension with some useful functions and filters.

Namespace

Drupal\webform\Twig

Code

public static function hasEditTwigAccess() {
  return \Drupal::currentUser()
    ->hasPermission('edit webform twig') || \Drupal::currentUser()
    ->hasPermission('administer webform');
}