You are here

function hosting_package_node_access in Hosting 7.3

Same name and namespace in other branches
  1. 7.4 package/hosting_package.module \hosting_package_node_access()

Implements hook_node_access(). @todo: check that we don't want to manage this through node_grants.

File

package/hosting_package.module, line 66
Defines package node types

Code

function hosting_package_node_access($node, $op, $account) {
  $type = is_string($node) ? $node : $node->type;
  if ($type != 'platform') {
    return NODE_ACCESS_IGNORE;
  }
  switch ($op) {
    case 'create':
      return user_access('create package', $account);
      break;
    case 'view':
      return user_access('view package', $account);
      break;
    case 'update':
      return user_access('edit package', $account);
      break;
    case 'delete':
      return user_access('delete package', $account);
      break;
    default:
      break;
  }
}