hook_node_access_records()

Robert Castelo's picture

In this example the 'philosophy' realm is set up and three grant IDs are set up:

function moderate_node_access_records($node) {
$grants = array();
if ($node->type == 'life_lesson') {

$grants[] = array(
'realm' => 'philosophy',
'gid' => 1,
'grant_view' => TRUE,
'grant_update' => FALSE,
'grant_delete' => FALSE,
'priority' => 100,
);

$grants[] = array(
'realm' => 'philosophy',
'gid' => 2,
'grant_view' => TRUE,
'grant_update' => TRUE,
'grant_delete' => FALSE,
'priority' => 100,
);

$grants[] = array(
'realm' => 'philosophy',
'gid' => 3,
'grant_view' => TRUE,
'grant_update' => TRUE,
'grant_delete' => TRUE,
'priority' => 100,
);
}

return $grants;
}