function devel_node_access_node_access_explain in Devel 6
Same name and namespace in other branches
- 5 devel_node_access.module \devel_node_access_node_access_explain()
- 7 devel_node_access.module \devel_node_access_node_access_explain()
Implementation of hook_node_access_explain().
Provide a (short!) textual explanation of this module's grant records.
Parameters
$row: Array with a row from the {node_access} table. The keys are: nid, gid, realm, grant_view, grant_update, grant_delete.
Return value
A (short!) HTML explanation of the given {node_access} row, to be displayed in DNA's 'Devel Node Access' block.
File
- ./
devel_node_access.module, line 757 - This module gives developers feedback as to what their node_access table contains, and which nodes are protected or visible to the public.
Code
function devel_node_access_node_access_explain($row) {
if ($row->gid == 0 && $row->realm == 'all') {
foreach (array(
'view',
'update',
'delete',
) as $op) {
$gop = 'grant_' . $op;
if (!empty($row->{$gop})) {
$ops[] = $op;
}
}
if (empty($ops)) {
return '(No access granted to ' . ($row->nid == 0 ? 'any nodes.)' : 'this node.)');
}
else {
return 'All users may ' . implode('/', $ops) . ($row->nid == 0 ? ' all nodes.' : ' this node.');
}
}
}