function AccessPolicyBase::getPersistentCacheContexts

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

Gets the persistent cache contexts.

These inform the system what your access policy's calculations always vary by. If you have any further cache contexts that you want to conditionally add, you can do so in calculatePermissions and alterPermissions.

Return value

string[] The persistent cache contexts.

Overrides AccessPolicyInterface::getPersistentCacheContexts

1 call to AccessPolicyBase::getPersistentCacheContexts()
AccessPolicyBase::calculatePermissions in core/lib/Drupal/Core/Session/AccessPolicyBase.php
Calculates the permissions for an account within a given scope.
9 methods override AccessPolicyBase::getPersistentCacheContexts()
AlwaysAddsAccessPolicy::getPersistentCacheContexts in core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php
Gets the persistent cache contexts.
AlwaysAltersAccessPolicy::getPersistentCacheContexts in core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php
Gets the persistent cache contexts.
BarAccessPolicy::getPersistentCacheContexts in core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php
Gets the persistent cache contexts.
BazAccessPolicy::getPersistentCacheContexts in core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php
Gets the persistent cache contexts.
FooAccessPolicy::getPersistentCacheContexts in core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php
Gets the persistent cache contexts.

... See full list

File

core/lib/Drupal/Core/Session/AccessPolicyBase.php, line 32

Class

AccessPolicyBase
Base class for access policies.

Namespace

Drupal\Core\Session

Code

public function getPersistentCacheContexts() : array {
    return [];
}

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