function PermissionsHashGenerator::getCacheableMetadata

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Session/PermissionsHashGenerator.php \Drupal\Core\Session\PermissionsHashGenerator::getCacheableMetadata()

Gets the cacheability metadata for the generated hash.

Parameters

\Drupal\Core\Session\AccountInterface $account: The user account for which to get the permissions hash.

Return value

\Drupal\Core\Cache\CacheableMetadata A cacheable metadata object.

Overrides PermissionsHashGeneratorInterface::getCacheableMetadata

File

core/lib/Drupal/Core/Session/PermissionsHashGenerator.php, line 125

Class

PermissionsHashGenerator
Generates and caches the permissions hash for a user.

Namespace

Drupal\Core\Session

Code

public function getCacheableMetadata(AccountInterface $account) : CacheableMetadata {
  return CacheableMetadata::createFromObject($this->processor
    ->processAccessPolicies($account));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.