32 private $storeManager;
37 private $authorization;
54 $this->router = $router;
56 $this->authorization = $authorization;
68 $this->checkPermissions();
69 $route = $this->router->match($this->request);
70 if ($route->isSecure() && !$this->request->isSecure()) {
71 throw new \Magento\Framework\Webapi\Exception(
__(
'Operation allowed only in HTTPS'));
81 private function checkPermissions()
83 $route = $this->router->match($this->request);
84 if (!$this->authorization->isAllowed($route->getAclResources())) {
85 $params = [
'resources' => implode(
', ', $route->getAclResources())];
87 __(
"The consumer isn't authorized to access %resources.",
$params)
__construct(RestRequest $request, Router $router, StoreManagerInterface $storeManager, Authorization $authorization)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]