hook_nodeapi()
$op = load
$op = view
function mymodule_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
switch ($op) {
case 'view':
drupal_access_denied();
exit();
break;
}
}
hook_init()
function mymodule_init() {
$nodes_403 = array(42, 69, 187);
if (arg(0) == 'node' && in_array(arg(1), $nodes_403))
drupal_access_denied();
exit();
}
}
node access rights
hook_access()
function mymodule_access($op, $node, $account) {
$nodes_403 = array(42, 69, 187);
if (in_array($node->nid, $nodes_403)) {
return FALSE;
}
}
access callback
function mymodule_menu_alter(&$items) {
$items['node/%node']['access callback'] = 'mymodule_access';
}
function mymodule_access($op, $node, $account = NULL) {
$nodes_403 = array(42, 69, 187);
if ($op == 'view' && in_array($node->nid, $nodes_403)) {
return FALSE;
}
return node_access($op, $node, $account);
}
hook_menu_alter()