diff --git a/src/Controller/AdminOrderController.php b/src/Controller/AdminOrderController.php index 89f8c57b..7da7a648 100644 --- a/src/Controller/AdminOrderController.php +++ b/src/Controller/AdminOrderController.php @@ -68,6 +68,8 @@ public function __construct(protected TranslatorInterface $translator) public function onKernelControllerEvent(ControllerEvent $event): void { + $this->checkPermission('bundle_ecommerce_back-office_order'); + // set language $user = $this->tokenResolver->getUser(); diff --git a/src/Controller/PricingController.php b/src/Controller/PricingController.php index a4a4714e..36d67add 100644 --- a/src/Controller/PricingController.php +++ b/src/Controller/PricingController.php @@ -43,10 +43,7 @@ class PricingController extends UserAwareController implements KernelControllerE public function onKernelControllerEvent(ControllerEvent $event): void { // permission check - $access = $this->getPimcoreUser()->isAllowed('bundle_ecommerce_pricing_rules'); - if (!$access) { - throw new \Exception('this function requires "bundle_ecommerce_pricing_rules" permission!'); - } + $this->checkPermission('bundle_ecommerce_pricing_rules'); } /**