function content_access_node_access_explain in Content Access 8
Same name and namespace in other branches
- 5 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()
Implements hook_node_access_explain().
File
- ./
content_access.module, line 655 - Content access module file.
Code
function content_access_node_access_explain($row) {
static $roles;
if (!isset($roles)) {
$roles = user_roles();
}
if (!$row->gid && $row->realm == 'content_access_roles') {
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_roles':
return t('Content access: %role can access', [
'%role' => $roles[$row->gid],
]);
}
}