AccountPermissionsCacheContext::getContext

public AccountPermissionsCacheContext::getContext() Returns the string representation of the cache context. A cache context service's name is used as a token (placeholder) cache key, and is then replaced with the string returned by this method. Return value string The string representation of the cache context. Overrides CacheContextInterface::getContext File core/lib/Drupal/Core/Cache/Context/AccountPermissionsCacheContext.php, line 46 Class AccountPermissionsCacheContext Defines the Acc

AccountPermissionsCacheContext::$permissionsHashGenerator

The permissions hash generator. Type: \Drupal\Core\Session\PermissionsHashGeneratorInterface File core/lib/Drupal/Core/Cache/Context/AccountPermissionsCacheContext.php, line 21 Class AccountPermissionsCacheContext Defines the AccountPermissionsCacheContext service, for "per permission" caching. Namespace Drupal\Core\Cache\Context Code protected $permissionsHashGenerator;

AccountPermissionsCacheContext::getCacheableMetadata

public AccountPermissionsCacheContext::getCacheableMetadata() Gets the cacheability metadata for the context. There are three valid cases for the returned CacheableMetadata object: An empty object means this can be optimized away safely. A max-age of 0 means that this context can never be optimized away. It will never bubble up and cache tags will not be used. Any non-zero max-age and cache tags will bubble up into the cache item if this is optimized away to allow for invalidation if the contex

AccountPermissionsCacheContext

Defines the AccountPermissionsCacheContext service, for "per permission" caching. Cache context ID: 'user.permissions'. Hierarchy class \Drupal\Core\Cache\Context\UserCacheContextBaseclass \Drupal\Core\Cache\Context\AccountPermissionsCacheContext implements CacheContextInterface File core/lib/Drupal/Core/Cache/Context/AccountPermissionsCacheContext.php, line 14 Namespace Drupal\Core\Cache\Context Members Name Modifiers Type Description AccountPermissionsCacheContext::$permiss

AccountInterface::isAuthenticated

public AccountInterface::isAuthenticated() Returns TRUE if the account is authenticated. Return value bool TRUE if the account is authenticated. File core/lib/Drupal/Core/Session/AccountInterface.php, line 61 Class AccountInterface Defines an account interface which represents the current user. Namespace Drupal\Core\Session Code public function isAuthenticated();

AccountInterface::getUsername

public AccountInterface::getUsername() 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 log in. For any other display purposes, use \Drupal\Core\Session\AccountInterface::getDisplayName() instead. Deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. Use \Drupa

AccountInterface::hasPermission

public AccountInterface::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. File core/lib/Drupal/Core/Session/AccountInterface.php, line 53 Class AccountInterface Defines an account interface which represents the current user. Namespace Drupal\Core\Session Code public function hasPermission($permission);

AccountInterface::isAnonymous

public AccountInterface::isAnonymous() Returns TRUE if the account is anonymous. Return value bool TRUE if the account is anonymous. File core/lib/Drupal/Core/Session/AccountInterface.php, line 69 Class AccountInterface Defines an account interface which represents the current user. Namespace Drupal\Core\Session Code public function isAnonymous();

AccountInterface::id

public AccountInterface::id() Returns the user ID or 0 for anonymous. Return value int The user ID. File core/lib/Drupal/Core/Session/AccountInterface.php, line 31 Class AccountInterface Defines an account interface which represents the current user. Namespace Drupal\Core\Session Code public function id();

AccountInterface::getRoles

public AccountInterface::getRoles($exclude_locked_roles = FALSE) Returns a list of roles. Parameters bool $exclude_locked_roles: (optional) If TRUE, locked roles (anonymous/authenticated) are not returned. Return value array List of role IDs. File core/lib/Drupal/Core/Session/AccountInterface.php, line 42 Class AccountInterface Defines an account interface which represents the current user. Namespace Drupal\Core\Session Code public function getRoles($exclude_locked_roles = FALSE);