You are here

function taxonomy_access_node_grants in Taxonomy Access Control 6

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. 7 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 312
Allows administrators to specify how each category (in the taxonomy) can be used by various roles.

Code

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