You are here

public function FulfillmentController::accessOrder in Ubercart 8.4

Checks access to fulfill this order.

Parameters

\Drupal\uc_order\OrderInterface $uc_order: The Order to check access for.

Return value

\Drupal\Core\Access\AccessResultInterface The access result.

1 call to FulfillmentController::accessOrder()
FulfillmentController::accessNewShipment in shipping/uc_fulfillment/src/Controller/FulfillmentController.php
Checks access to the Shipments tab for this order.
1 string reference to 'FulfillmentController::accessOrder'
uc_fulfillment.routing.yml in shipping/uc_fulfillment/uc_fulfillment.routing.yml
shipping/uc_fulfillment/uc_fulfillment.routing.yml

File

shipping/uc_fulfillment/src/Controller/FulfillmentController.php, line 23

Class

FulfillmentController
Controller routines for order routes.

Namespace

Drupal\uc_fulfillment\Controller

Code

public function accessOrder(OrderInterface $uc_order) {
  $account = \Drupal::currentUser();
  return AccessResult::allowedIf($account
    ->hasPermission('fulfill orders') && $uc_order
    ->isShippable());
}