You are here

function tac_lite_node_grants in Taxonomy Access Control Lite 5

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

Implementation of hook_node_grants

Returns any grants which may give the user permission to perform the requested op.

File

./tac_lite.module, line 439
Control access to site content based on taxonomy, roles and users.

Code

function tac_lite_node_grants(&$account, &$op) {
  $grants = array();
  for ($i = 1; $i <= variable_get('tac_lite_schemes', 1); $i++) {
    $config = _tac_lite_config($i);
    if (in_array('grant_' . $op, $config['perms'])) {
      $grants[$config['realm']] = _tac_lite_user_tids($account, $i);
    }
  }
  if (count($grants)) {
    return $grants;
  }
}