You are here

function pm_node_access in Drupal PM (Project Management) 8

Same name and namespace in other branches
  1. 7.3 pm.module \pm_node_access()

Implements hook_node_access().

File

./pm.module, line 840
Main module file for the Project Management module.

Code

function pm_node_access($node, $op, $account) {
  $type = is_string($node) ? $node : $node->type;
  if (variable_get("pm_permission_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;
}