You are here

function acl_node_grants in ACL 5

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

Implementation of hook_node_grants

File

./acl.module, line 252
acl.module

Code

function acl_node_grants($account, $op) {
  $array = array(
    'acl' => array(),
  );
  $result = db_query("SELECT acl_id FROM {acl_user} WHERE uid = %d", $account->uid);
  while ($row = db_fetch_object($result)) {
    $array['acl'][] = $row->acl_id;
  }
  return !empty($array['acl']) ? $array : NULL;
}