Hello,
I am experiencing difficulty in understanding how we control whether a "delete" button is shown on a group edit page
which is published by an ordinary group subscriber and viewed by a moderator because of a mysterious call to node_access() ....
When a moderator loads the group "page" for editing we first call node_access('update', $node) and this works fine with access to the page being denied from page_access but then allowed because of records in the {node_access} table
node.module
640
/**
* Implementation of hook_menu().
*/
function node_menu($may_cache) {
$items = array();
..
691
$items[] = array('path' => 'node/'. arg(1) .'/edit', 'title' => t('edit'),
'callback' => 'node_page',
'access' => node_access('update', $node),
'weight' => 1,
'type' => MENU_LOCAL_TASK);
Later when we render the delete button in the page ...
1275
/**
* Generate the node editing form.
*/
function node_form($edit) {
..
1364
if ($edit->nid && node_access('delete', $edit)) {
$output .= form_submit(t('Delete'));
}
...we make the second call to node_access which returns TRUE firstly because of what is in the
{node_access} table and then again later because of a none NULL return from page_access (called from node_access) because
the node has somehow been assigned to the moderator requesting the page and it is this
second call which has the final word on whether the "delete" button is rendered on the page