You are here

function acl_node_grants in ACL 8

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

Implements hook_node_grants().

File

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

Code

function acl_node_grants($account, $op) {
  $acl_ids = \Drupal::database()
    ->query("SELECT acl_id FROM {acl_user} WHERE uid = :uid", [
    'uid' => $account
      ->id(),
  ])
    ->fetchCol();
  return !empty($acl_ids) ? [
    'acl' => $acl_ids,
  ] : NULL;
}