class BazAccessPolicy

Same name in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php \Drupal\Tests\Core\Session\BazAccessPolicy

Hierarchy

Expanded class hierarchy of BazAccessPolicy

File

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

Namespace

Drupal\Tests\Core\Session
View source
class BazAccessPolicy extends AccessPolicyBase {
    public function applies(string $scope) : bool {
        return $scope === 'baz';
    }
    public function calculatePermissions(AccountInterface $account, string $scope) : RefinableCalculatedPermissionsInterface {
        $calculated_permissions = parent::calculatePermissions($account, $scope);
        return $calculated_permissions->addItem(new CalculatedPermissionsItem([
            'baz',
        ], FALSE, 'baz', 1));
    }
    public function getPersistentCacheContexts() : array {
        return [
            'baz',
        ];
    }

}

Members


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