You are here

function content_access_get_role_gid in Content Access 8

Helper providing numeric id for role.

4 calls to content_access_get_role_gid()
content_access_get_type_grant in ./content_access.module
Returns the default grants for a given node type.
content_access_node_access_records in ./content_access.module
Implements hook_node_access_records().
content_access_node_grants in ./content_access.module
Implements hook_node_grants().
content_access_optimize_grants in ./content_access.module
Removes grants that doesn't change anything.

File

./content_access.module, line 718
Content access module file.

Code

function content_access_get_role_gid($role) {
  $config = \Drupal::configFactory()
    ->getEditable('content_access.settings');
  $roles_gids = $config
    ->get('content_access_roles_gids');
  if (empty($roles_gids) || !array_key_exists($role, $roles_gids)) {
    return null;
  }
  return $roles_gids[$role];
}