You are here

function pmorganization_node_access in Drupal PM (Project Management) 7

Implements hook_node_access().

Define node access requirements for Project Management Organization nodes.

File

pmorganization/pmorganization.module, line 74

Code

function pmorganization_node_access($node, $op, $account = NULL) {
  $type = is_string($node) ? $node : $node->type;

  // If no account is specified, assume that the check is against the current logged in user
  if (is_null($account)) {
    global $user;
    $account = $user;
  }
  if ($type == 'pmorganization' && $op == 'create') {
    if (user_access('Project Management Organization: add', $account)) {
      return NODE_ACCESS_ALLOW;
    }
  }
  return NODE_ACCESS_IGNORE;
}