You are here

class CSRFCallbackAccessCheck in Brightcove Video Connect 8.2

Same name and namespace in other branches
  1. 8 src/Access/CSRFCallbackAccessCheck.php \Drupal\brightcove\Access\CSRFCallbackAccessCheck
  2. 3.x src/Access/CSRFCallbackAccessCheck.php \Drupal\brightcove\Access\CSRFCallbackAccessCheck

Custom CSRF access check callback.

Hierarchy

Expanded class hierarchy of CSRFCallbackAccessCheck

1 string reference to 'CSRFCallbackAccessCheck'
brightcove.services.yml in ./brightcove.services.yml
brightcove.services.yml
1 service uses CSRFCallbackAccessCheck
brightcove.access_check in ./brightcove.services.yml
Drupal\brightcove\Access\CSRFCallbackAccessCheck

File

src/Access/CSRFCallbackAccessCheck.php, line 12

Namespace

Drupal\brightcove\Access
View source
class CSRFCallbackAccessCheck implements AccessInterface {

  /**
   * Custom access callback.
   *
   * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
   *   RouterMatch object.
   *
   * @return \Drupal\Core\Access\AccessResult
   *   Access allowed only if the token is exists and did not expired.
   */
  public function access(RouteMatchInterface $route_match) {
    $token = $route_match
      ->getParameter('token');
    return AccessResult::allowedIf(\Drupal::keyValueExpirable('brightcove_callback')
      ->has($token));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CSRFCallbackAccessCheck::access public function Custom access callback.