You are here

function content_access_node_access_explain in Content Access 7

Same name and namespace in other branches
  1. 8 content_access.module \content_access_node_access_explain()
  2. 5 content_access.module \content_access_node_access_explain()
  3. 6 content_access.module \content_access_node_access_explain()

Implements hook_node_access_explain().

File

./content_access.module, line 572
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_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],
      ));
  }
}