Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Section.php
Go to the documentation of this file.
1 <?php
7 
13 {
19  protected $_authorization;
20 
27  public function __construct(
29  \Magento\Framework\Module\Manager $moduleManager,
30  Iterator $childrenIterator,
31  \Magento\Framework\AuthorizationInterface $authorization
32  ) {
33  parent::__construct($storeManager, $moduleManager, $childrenIterator);
34  $this->_authorization = $authorization;
35  }
36 
42  public function getHeaderCss()
43  {
44  return isset($this->_data['header_css']) ? $this->_data['header_css'] : '';
45  }
46 
52  public function isAllowed()
53  {
54  return isset($this->_data['resource']) ? $this->_authorization->isAllowed($this->_data['resource']) : false;
55  }
56 
62  public function isVisible()
63  {
64  if (!$this->isAllowed()) {
65  return false;
66  }
67  return parent::isVisible();
68  }
69 }
$storeManager
__construct(\Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Module\Manager $moduleManager, Iterator $childrenIterator, \Magento\Framework\AuthorizationInterface $authorization)
Definition: Section.php:27