Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ConfigSectionChecker.php
Go to the documentation of this file.
1 <?php
8 
10 
16 {
20  protected $_configStructure;
21 
25  public function __construct(\Magento\Config\Model\Config\Structure $configStructure)
26  {
27  $this->_configStructure = $configStructure;
28  }
29 
40  public function isSectionAllowed($sectionId)
41  {
42  try {
43  if (false == $this->_configStructure->getElement($sectionId)->isAllowed()) {
44  throw new \Exception('');
45  }
46  return true;
47  } catch (\Zend_Acl_Exception $e) {
48  throw new NotFoundException(__('Page not found.'));
49  } catch (\Exception $e) {
50  return false;
51  }
52  }
53 }
__construct(\Magento\Config\Model\Config\Structure $configStructure)
__()
Definition: __.php:13