You are here

public static function WebformAccountAccess::checkAdminAccess in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Access/WebformAccountAccess.php \Drupal\webform\Access\WebformAccountAccess::checkAdminAccess()

Check whether the user has 'administer webform' or 'administer webform submission' permission.

Parameters

\Drupal\Core\Session\AccountInterface $account: Run access checks for this account.

Return value

\Drupal\Core\Access\AccessResultInterface The access result.

1 call to WebformAccountAccess::checkAdminAccess()
WebformAccountAccessTest::testWebformAccountAccess in tests/src/Unit/Access/WebformAccountAccessTest.php
Tests the check webform account access.

File

src/Access/WebformAccountAccess.php, line 23

Class

WebformAccountAccess
Defines the custom access control handler for the user accounts.

Namespace

Drupal\webform\Access

Code

public static function checkAdminAccess(AccountInterface $account) {
  return AccessResult::allowedIfHasPermissions($account, [
    'administer webform',
    'administer webform submission',
  ], 'OR');
}