class CSRFCallbackAccessCheck in Brightcove Video Connect 8
Same name and namespace in other branches
- 8.2 src/Access/CSRFCallbackAccessCheck.php \Drupal\brightcove\Access\CSRFCallbackAccessCheck
- 3.x src/Access/CSRFCallbackAccessCheck.php \Drupal\brightcove\Access\CSRFCallbackAccessCheck
Custom CSRF access check callback.
Hierarchy
- class \Drupal\brightcove\Access\CSRFCallbackAccessCheck implements AccessInterface
Expanded class hierarchy of CSRFCallbackAccessCheck
1 string reference to 'CSRFCallbackAccessCheck'
1 service uses CSRFCallbackAccessCheck
File
- src/
Access/ CSRFCallbackAccessCheck.php, line 12
Namespace
Drupal\brightcove\AccessView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CSRFCallbackAccessCheck:: |
public | function | Custom access callback. |