You are here

function casetracker_basic_project_node_access in Case Tracker 7

Implements hook_node_access().

File

./casetracker_basic.module, line 71
Enables a basic project node type for use with Case Tracker.

Code

function casetracker_basic_project_node_access($node, $op, $account) {
  switch ($op) {
    case 'create':
      return user_access('create projects', $account);
      break;
    case 'update':
    case 'delete':
      if (user_access('edit any project') || user_access('edit own projects', $account) && $account->uid == $node->uid) {
        return TRUE;
      }
      break;
  }
}