Skip to content

Commit

Permalink
add permission check
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjia90 committed Jan 8, 2024
1 parent ed41ae5 commit 2280e03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/Controller/AdminOrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
5 changes: 1 addition & 4 deletions src/Controller/PricingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

/**
Expand Down

0 comments on commit 2280e03

Please sign in to comment.