You are here

function acl_has_users in ACL 8

Same name and namespace in other branches
  1. 5 acl.module \acl_has_users()
  2. 6 acl.module \acl_has_users()
  3. 7 acl.module \acl_has_users()

Determine whether an ACL has some assigned users.

1 call to acl_has_users()
acl_node_access_records in ./acl.module
Implements hook_node_access_records().

File

./acl.module, line 251
An API module providing by-user access control lists.

Code

function acl_has_users($acl_id) {
  return \Drupal::database()
    ->query("SELECT COUNT(uid) FROM {acl_user} WHERE acl_id = :acl_id", [
    'acl_id' => $acl_id,
  ])
    ->fetchField();
}