Skip to content

Instantly share code, notes, and snippets.

@a-fro
Created February 6, 2014 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a-fro/8847292 to your computer and use it in GitHub Desktop.
Save a-fro/8847292 to your computer and use it in GitHub Desktop.
Node access example
function mymodule_node_access($node, $op, $account) {
$controlled_nids = array(
1,
2
);
if (isset($node->nid) && in_array($node->nid, $controlled_nids)) {
$acceptable_users = array(
'2',
);
if (!in_array($account->uid, $acceptable_users)) {
return NODE_ACCESS_DENY;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment