You are here

function pmpermission_node_access in Drupal PM (Project Management) 7.2

Implements hook_node_access().

File

pmpermission/pmpermission.module, line 771
Main module file for the pmpermission module.

Code

function pmpermission_node_access($node, $op, $account) {
  $type = is_string($node) ? $node : $node->type;
  if (variable_get("pmpermission_node_{$type}_enabled", FALSE) && $op == 'create') {
    if (user_access("PM permission {$type}: create", $account)) {
      return NODE_ACCESS_ALLOW;
    }
  }

  // Returning nothing from this function would have the same effect.
  return NODE_ACCESS_IGNORE;
}