interface PermissionsHashGeneratorInterface

Same name in other branches
  1. 9 core/lib/Drupal/Core/Session/PermissionsHashGeneratorInterface.php \Drupal\Core\Session\PermissionsHashGeneratorInterface
  2. 8.9.x core/lib/Drupal/Core/Session/PermissionsHashGeneratorInterface.php \Drupal\Core\Session\PermissionsHashGeneratorInterface
  3. 10 core/lib/Drupal/Core/Session/PermissionsHashGeneratorInterface.php \Drupal\Core\Session\PermissionsHashGeneratorInterface

Defines the user permissions hash generator interface.

Hierarchy

Expanded class hierarchy of PermissionsHashGeneratorInterface

All classes that implement PermissionsHashGeneratorInterface

1 file declares its use of PermissionsHashGeneratorInterface
AccountPermissionsCacheContext.php in core/lib/Drupal/Core/Cache/Context/AccountPermissionsCacheContext.php

File

core/lib/Drupal/Core/Session/PermissionsHashGeneratorInterface.php, line 10

Namespace

Drupal\Core\Session
View source
interface PermissionsHashGeneratorInterface {
    
    /**
     * Generates a hash that uniquely identifies a user's permissions.
     *
     * @param \Drupal\Core\Session\AccountInterface $account
     *   The user account for which to get the permissions hash.
     *
     * @return string
     *   A permissions hash.
     */
    public function generate(AccountInterface $account);
    
    /**
     * Gets the cacheability metadata for the generated hash.
     *
     * @param \Drupal\Core\Session\AccountInterface $account
     *   The user account for which to get the permissions hash.
     *
     * @return \Drupal\Core\Cache\CacheableMetadata
     *   A cacheable metadata object.
     */
    public function getCacheableMetadata(AccountInterface $account) : CacheableMetadata;

}

Members

Title Sort descending Modifiers Object type Summary Overrides
PermissionsHashGeneratorInterface::generate public function Generates a hash that uniquely identifies a user's permissions. 1
PermissionsHashGeneratorInterface::getCacheableMetadata public function Gets the cacheability metadata for the generated hash. 1

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