function UserRolesAccessPolicy::getPersistentCacheContexts

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

Overrides AccessPolicyBase::getPersistentCacheContexts

File

core/lib/Drupal/Core/Session/UserRolesAccessPolicy.php, line 37

Class

UserRolesAccessPolicy
Grants permissions based on a user's roles.

Namespace

Drupal\Core\Session

Code

public function getPersistentCacheContexts() : array {
    return [
        'user.roles',
    ];
}

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