You are here

function acl_has_user in ACL 8

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

Determine whether an ACL has a specific assigned user.

1 call to acl_has_user()
AclMigrationTestTrait::testMigration in src/Tests/AclMigrationTestTrait.php
Tests migration of ACL List.

File

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

Code

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