You are here

function tac_lite_node_grants in Taxonomy Access Control Lite 7

Same name and namespace in other branches
  1. 8 tac_lite.module \tac_lite_node_grants()
  2. 5 tac_lite.module \tac_lite_node_grants()
  3. 6 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 673
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;
  }
}