You are here

private function ContentHubUserSession::getContentHubRenderUserRoles in Acquia Content Hub 8

Same name and namespace in other branches
  1. 8.2 src/Session/ContentHubUserSession.php \Drupal\acquia_contenthub\Session\ContentHubUserSession::getContentHubRenderUserRoles()

Obtains the user roles based on the module settings.

Parameters

string $render_role: Role to view content.

Return value

array Array of roles.

1 call to ContentHubUserSession::getContentHubRenderUserRoles()
ContentHubUserSession::__construct in src/Session/ContentHubUserSession.php
Constructs a new Content Hub user session.

File

src/Session/ContentHubUserSession.php, line 40

Class

ContentHubUserSession
An account implementation representing a Content Hub user.

Namespace

Drupal\acquia_contenthub\Session

Code

private function getContentHubRenderUserRoles($render_role) {
  switch ($render_role) {
    case AccountInterface::ANONYMOUS_ROLE:
    case AccountInterface::AUTHENTICATED_ROLE:
      $roles = [
        $render_role,
      ];
      break;
    default:
      $roles = [
        AccountInterface::AUTHENTICATED_ROLE,
        $render_role,
      ];
      break;
  }
  return $roles;
}