UserSession::getRoleStorage

protected 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 204 Class UserSession An implementation of the user account interface for the global user. Namespace Drupal\Core\Session Code protected function getRoleStorage() { return \Drupal::entityManager()->getStorage('user_role'); }

UserSession::hasPermission

public UserSession::hasPermission($permission) Checks whether a user has a certain permission. Parameters string $permission: The permission string to check. Return value bool TRUE if the user has the permission, FALSE otherwise. Overrides AccountInterface::hasPermission File core/lib/Drupal/Core/Session/UserSession.php, line 105 Class UserSession An implementation of the user account interface for the global user. Namespace Drupal\Core\Session Code public function hasPermission($per

UserSession::getPreferredLangcode

UserSession::getPreferredLangcode($fallback_to_default = TRUE) Returns the preferred language code of the account. Parameters bool $fallback_to_default: (optional) Whether the return value will fall back to the site default language if the user has no language preference. Return value string The language code that is preferred by the account. If the preferred language is not set or is a language not configured anymore on the site, the site default is returned or an empty string is returned (i

UserSession::getEmail

public UserSession::getEmail() Returns the email address of this account. Return value string The email address. Overrides AccountInterface::getEmail File core/lib/Drupal/Core/Session/UserSession.php, line 180 Class UserSession An implementation of the user account interface for the global user. Namespace Drupal\Core\Session Code public function getEmail() { return $this->mail; }

UserSession::getLastAccessedTime

public UserSession::getLastAccessedTime() The timestamp when the account last accessed the site. A value of 0 means the user has never accessed the site. Return value int Timestamp of the last access. Overrides AccountInterface::getLastAccessedTime File core/lib/Drupal/Core/Session/UserSession.php, line 194 Class UserSession An implementation of the user account interface for the global user. Namespace Drupal\Core\Session Code public function getLastAccessedTime() { return $this->

UserSession::getPreferredAdminLangcode

UserSession::getPreferredAdminLangcode($fallback_to_default = TRUE) Returns the preferred administrative language code of the account. Defines which language is used on administrative pages. Parameters bool $fallback_to_default: (optional) Whether the return value will fall back to the site default language if the user has no administration language preference. Return value string The language code that is preferred by the account for administration pages. If the preferred language is not set

UserSession::getDisplayName

public UserSession::getDisplayName() Returns the display name of this account. By default, the passed-in object's 'name' property is used if it exists, or else, the site-defined value for the 'anonymous' variable. However, a module may override this by implementing hook_user_format_name_alter(&$name, $account). Return value string|\Drupal\Component\Render\MarkupInterface Either a string that will be auto-escaped on output or a MarkupInterface object that is already HTML escaped. Either is

UserSession::$timezone

The timezone of this account. Type: string File core/lib/Drupal/Core/Session/UserSession.php, line 68 Class UserSession An implementation of the user account interface for the global user. Namespace Drupal\Core\Session Code protected $timezone;

UserSession::$preferred_admin_langcode

The preferred administrative language code of the account. Type: string File core/lib/Drupal/Core/Session/UserSession.php, line 54 Class UserSession An implementation of the user account interface for the global user. Namespace Drupal\Core\Session Code protected $preferred_admin_langcode;

UserSession::getAccountName

public UserSession::getAccountName() Returns the unaltered login name of this account. Return value string An unsanitized plain-text string with the name of this account that is used to log in. Only display this name to admins and to the user who owns this account, and only in the context of the name used to login. For any other display purposes, use \Drupal\Core\Session\AccountInterface::getDisplayName() instead. Overrides AccountInterface::getAccountName File core/lib/Drupal/Core/Session/Use