You are here

function taxonomy_access_node_grants in Taxonomy Access Control 7

Same name and namespace in other branches
  1. 5.2 taxonomy_access.module \taxonomy_access_node_grants()
  2. 5 taxonomy_access.module \taxonomy_access_node_grants()
  3. 6 taxonomy_access.module \taxonomy_access_node_grants()

Implements hook_node_grants().

Gives access to taxonomies based on the taxonomy_access table.

File

./taxonomy_access.module, line 252
Allows administrators to specify access control for taxonomy categories.

Code

function taxonomy_access_node_grants($user, $op) {
  $roles = is_array($user->roles) ? array_keys($user->roles) : -1;
  return array(
    'taxonomy_access_role' => $roles,
  );
}