_configStructure = $configStructure; } /** * Check if specified section allowed in ACL * * Will forward to deniedAction(), if not allowed. * * @param string $sectionId * @throws \Exception * @return bool * @throws NotFoundException */ public function isSectionAllowed($sectionId) { try { if (false == $this->_configStructure->getElement($sectionId)->isAllowed()) { // phpcs:ignore Magento2.Exceptions.DirectThrow throw new \Exception(''); } return true; } catch (InvalidArgumentException $e) { // phpcs:ignore Magento2.Exceptions.ThrowCatch throw new NotFoundException(__('Page not found.')); // phpcs:ignore Magento2.Exceptions.ThrowCatch } catch (\Exception $e) { return false; } } }