class UserContextAccessPolicy

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php \Drupal\Tests\Core\Session\UserContextAccessPolicy

A test access policy class that sets a context.

Hierarchy

Expanded class hierarchy of UserContextAccessPolicy

File

core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php, line 564

Namespace

Drupal\Tests\Core\Session
View source
class UserContextAccessPolicy extends AccessPolicyBase {
  public function applies(string $scope) : bool {
    return TRUE;
  }
  public function getPersistentCacheContexts() : array {
    return [
      'user',
    ];
  }

}

Members


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