Created
February 6, 2014 16:12
-
-
Save a-fro/8847292 to your computer and use it in GitHub Desktop.
Node access example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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