class PaymentOperationAccessCheck in Commerce Core 8.2
Provides an access checker for payment operations.
Hierarchy
- class \Drupal\commerce_payment\Access\PaymentOperationAccessCheck implements AccessInterface
Expanded class hierarchy of PaymentOperationAccessCheck
1 string reference to 'PaymentOperationAccessCheck'
- commerce_payment.services.yml in modules/
payment/ commerce_payment.services.yml - modules/payment/commerce_payment.services.yml
1 service uses PaymentOperationAccessCheck
File
- modules/
payment/ src/ Access/ PaymentOperationAccessCheck.php, line 13
Namespace
Drupal\commerce_payment\AccessView source
class PaymentOperationAccessCheck implements AccessInterface {
/**
* Checks access to the payment operation on the given route.
*
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The route match.
* @param \Drupal\Core\Session\AccountInterface $account
* The current user account.
*
* @return \Drupal\Core\Access\AccessResultInterface
* The access result.
*/
public function access(RouteMatchInterface $route_match, AccountInterface $account) {
$entity = $route_match
->getParameter('commerce_payment');
$operation = $route_match
->getParameter('operation');
if (empty($entity) || empty($operation)) {
return AccessResult::neutral();
}
return $entity
->access($operation, $account, TRUE);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PaymentOperationAccessCheck:: |
public | function | Checks access to the payment operation on the given route. |