function hosting_package_node_access in Hosting 7.4
Same name and namespace in other branches
- 7.3 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;
}
}