function content_access_node_access_explain in Content Access 5
Same name and namespace in other branches
- 8 content_access.module \content_access_node_access_explain()
- 6 content_access.module \content_access_node_access_explain()
- 7 content_access.module \content_access_node_access_explain()
Implementation of hook_node_access_explain().
File
- ./
content_access.module, line 634
Code
function content_access_node_access_explain($row) {
static $roles;
if (!isset($roles)) {
$roles = user_roles();
}
if (!$row->gid && $row->realm == 'content_access_rid') {
return t('Content access: No access is granted.');
}
switch ($row->realm) {
case 'content_access_author':
return t('Content access: author of the content can access');
case 'content_access_rid':
return t('Content access: %role can access', array(
'%role' => $roles[$row->gid],
));
}
}