You are here

public static function YamlFormAccess::checkAdminAccess in YAML Form 8

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

Parameters

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

Return value

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

File

src/Access/YamlFormAccess.php, line 25

Class

YamlFormAccess
Defines the custom access control handler for the form entities.

Namespace

Drupal\yamlform\Access

Code

public static function checkAdminAccess(AccountInterface $account) {
  return AccessResult::allowedIf($account
    ->hasPermission('administer yamlform') || $account
    ->hasPermission('administer yamlform submission'));
}