You are here

function pmteam_node_access in Drupal PM (Project Management) 7

Same name and namespace in other branches
  1. 8 pmteam/pmteam.module \pmteam_node_access()
  2. 7.3 pmteam/pmteam.module \pmteam_node_access()
  3. 7.2 pmteam/pmteam.module \pmteam_node_access()

Implements hook_node_access().

File

pmteam/pmteam.module, line 127
Functionality for the Project Management Team module Organized into the following sections:

Code

function pmteam_node_access($node, $op, $account = NULL) {
  $type = is_string($node) ? $node : $node->type;
  if ($type == 'pmteam') {

    // 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 ($op == 'create' and user_access('Project Management Team: add', $account)) {
      return NODE_ACCESS_ALLOW;
    }
  }
  return NODE_ACCESS_IGNORE;
}