function hosting_site_node_access in Hosting 7.4
Same name and namespace in other branches
- 7.3 site/hosting_site.module \hosting_site_node_access()
Implements hook_node_access().
File
- site/
hosting_site.module, line 400 - Contains hook implementations for Hosting site module.
Code
function hosting_site_node_access($node, $op, $account) {
if (hosting_feature('client') && $op != 'create') {
// We rely on hosting_client_node_grants() instead of global configuration.
return NODE_ACCESS_IGNORE;
}
$type = is_string($node) ? $node : $node->type;
if ($type != 'site') {
return NODE_ACCESS_IGNORE;
}
if ($op == 'create' && user_access('create site', $account)) {
return NODE_ACCESS_ALLOW;
}
if ($op == 'update' && user_access('edit site', $account)) {
return NODE_ACCESS_ALLOW;
}
if ($op == 'delete' && user_access('delete site', $account)) {
return NODE_ACCESS_ALLOW;
}
if ($op == 'view' && user_access('view site', $account)) {
return NODE_ACCESS_ALLOW;
}
}