You are here

function commerce_paypal_commerce_checkout_flow_access in Commerce PayPal 8

Implements hook_ENTITY_TYPE_access().

Forbids the "paypal_checkout" checkout flow from being deletable.

File

./commerce_paypal.module, line 139
Implements PayPal payment services for use with Drupal Commerce.

Code

function commerce_paypal_commerce_checkout_flow_access(CheckoutFlowInterface $checkout_flow, $operation, AccountInterface $account) {
  if ($checkout_flow
    ->id() === 'paypal_checkout' && $operation === 'delete') {
    return AccessResult::forbidden();
  }
  return AccessResult::neutral();
}