You are here

function pmnote_node_access in Drupal PM (Project Management) 7

Implements hook_node_access().

File

pmnote/pmnote.module, line 77
Functions for the PM Note module.

Code

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

    // 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 note: add', $account)) {
      return NODE_ACCESS_ALLOW;
    }
  }
  return NODE_ACCESS_IGNORE;
}