Skip to content

Instantly share code, notes, and snippets.

@ruthgeridema
Created April 15, 2019 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruthgeridema/9edac8c81874b671918150dae3402ce5 to your computer and use it in GitHub Desktop.
Save ruthgeridema/9edac8c81874b671918150dae3402ce5 to your computer and use it in GitHub Desktop.
Index: vendor/fooman/pdfcustomiser-implementation-m2/src/Plugin/Order/GuestPrintShipment.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- vendor/fooman/pdfcustomiser-implementation-m2/src/Plugin/Order/GuestPrintShipment.php (date 1555328863000)
+++ vendor/fooman/pdfcustomiser-implementation-m2/src/Plugin/Order/GuestPrintShipment.php (date 1555328863000)
@@ -34,8 +34,11 @@
if ($shipmentId) {
$shipment = $this->shipmentRepository->get($shipmentId);
-
- if ($shipment) {
+ $shipmentOrder = $shipment->getOrder();
+
+ if ($shipment &&
+ $this->orderViewAuthorization->canView($shipmentOrder)
+ ) {
$document = $this->shipmentDocumentFactory->create(
['data' => ['shipment' => $shipment]]
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment