You are here

public function GroupPermissionsHashGenerator::getCacheableMetadata in Group 8

Same name and namespace in other branches
  1. 2.0.x src/Access/GroupPermissionsHashGenerator.php \Drupal\group\Access\GroupPermissionsHashGenerator::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 GroupPermissionsHashGeneratorInterface::getCacheableMetadata

File

src/Access/GroupPermissionsHashGenerator.php, line 107

Class

GroupPermissionsHashGenerator
Generates and caches the permissions hash for a group membership.

Namespace

Drupal\group\Access

Code

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