You are here

protected function UserSession::getRoleStorage in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Session/UserSession.php \Drupal\Core\Session\UserSession::getRoleStorage()
  2. 9 core/lib/Drupal/Core/Session/UserSession.php \Drupal\Core\Session\UserSession::getRoleStorage()

Returns the role storage object.

Return value

\Drupal\user\RoleStorageInterface The role storage object.

File

core/lib/Drupal/Core/Session/UserSession.php, line 197

Class

UserSession
An implementation of the user account interface for the global user.

Namespace

Drupal\Core\Session

Code

protected function getRoleStorage() {
  return \Drupal::entityTypeManager()
    ->getStorage('user_role');
}