realm == 'mymodule_myrealm') { if ($row->grant_view) { $role = user_role_load($row->gid); return 'Role ' . drupal_placeholder($role->name) . ' may view this node.'; } else { return 'No access.'; } } } /** * Acknowledge ownership of 'alien' grant records. * * Some node access modules store grant records directly into the {node_access} * table rather than returning them through hook_node_access_records(). This * practice is not recommended and DNA will flag all such records as 'alien'. * * If this is unavoidable, a module can confess to being the owner of these * grant records, so that DNA can properly attribute them. * * @see hook_node_access_records() * * @ingroup node_access */ function hook_node_access_acknowledge($grant) { if ($grant['realm'] == 'mymodule_all' && $grant['nid'] == 0) { return TRUE; } } /** * @} End of "addtogroup hooks". */