You are here

class AnonymousCsrfAccessCheck in Anonymous CSRF Token 2.x

Class AnonymousCsrfAccessCheck.

@package Drupal\anonymous_token\Access

Hierarchy

Expanded class hierarchy of AnonymousCsrfAccessCheck

1 string reference to 'AnonymousCsrfAccessCheck'
anonymous_token.services.yml in ./anonymous_token.services.yml
anonymous_token.services.yml
1 service uses AnonymousCsrfAccessCheck
access_check.anonymous_token.csrf in ./anonymous_token.services.yml
Drupal\anonymous_token\Access\AnonymousCsrfAccessCheck

File

src/Access/AnonymousCsrfAccessCheck.php, line 12

Namespace

Drupal\anonymous_token\Access
View source
class AnonymousCsrfAccessCheck extends CsrfAccessCheck {

  /**
   * The CSRF token generator.
   *
   * @var \Drupal\anonymous_token\Access\AnonymousCsrfTokenGenerator
   */
  protected $csrfToken;

  /**
   * Constructs a AnonymousCsrfAccessCheck object.
   *
   * @param \Drupal\anonymous_token\Access\AnonymousCsrfTokenGenerator $csrf_token
   *   The CSRF token generator.
   */
  public function __construct(AnonymousCsrfTokenGenerator $csrf_token) {

    // We can't pass it to the parent as it's annotated with a class and not an
    // interface so override it here.
    $this->csrfToken = $csrf_token;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AnonymousCsrfAccessCheck::$csrfToken protected property The CSRF token generator. Overrides CsrfAccessCheck::$csrfToken
AnonymousCsrfAccessCheck::__construct public function Constructs a AnonymousCsrfAccessCheck object. Overrides CsrfAccessCheck::__construct
CsrfAccessCheck::access public function Checks access based on a CSRF token for the request.