You are here

protected static function WebformAccessGroupAccess::isAdmin in Webform 8.5

Same name and namespace in other branches
  1. 6.x modules/webform_access/src/Access/WebformAccessGroupAccess.php \Drupal\webform_access\Access\WebformAccessGroupAccess::isAdmin()

Determine if a user account is am administrator for any access group.

Parameters

\Drupal\Core\Session\AccountInterface $account: A user account.

Return value

bool TRUE if a user account is am administrator for any access group.

1 call to WebformAccessGroupAccess::isAdmin()
WebformAccessGroupAccess::checkAdminAccess in modules/webform_access/src/Access/WebformAccessGroupAccess.php
Check whether the current user is a administor or assign admin access.

File

modules/webform_access/src/Access/WebformAccessGroupAccess.php, line 44

Class

WebformAccessGroupAccess
Defines the custom access control handler for the webform access groups.

Namespace

Drupal\webform_access\Access

Code

protected static function isAdmin(AccountInterface $account) {
  return \Drupal::database()
    ->select('webform_access_group_admin', 'gu')
    ->fields('gu', [
    'group_id',
  ])
    ->condition('uid', $account
    ->id())
    ->range(0, 1)
    ->execute()
    ->fetchField() ? TRUE : FALSE;
}