/** * @param \Magento\Backend\Block\Template\Context $context * @param array $data */ public function __construct(\Magento\Backend\Block\Template\Context $context, array $data = []) { parent::__construct($context, $data); if (!$this->_request->getParam('id') || !$this->_authorization->isAllowed('Magento_Review::reviews_all')) { $this->setCanShow(false); } }
/** * @param \Magento\Backend\Block\Template\Context $context * @param array $data */ public function __construct(\Magento\Backend\Block\Template\Context $context, array $data = []) { parent::__construct($context, $data); if (!$this->_request->getParam('id') || !$this->_authorization->isAllowed('Kuzman_ProductFaq::product_faq')) { $this->setCanShow(false); } }
/** * Tab is hidden * * @return bool */ public function canShowTab() { $alertPriceAllow = $this->_scopeConfig->getValue('catalog/productalert/allow_price', \Magento\Store\Model\ScopeInterface::SCOPE_STORE); $alertStockAllow = $this->_scopeConfig->getValue('catalog/productalert/allow_stock', \Magento\Store\Model\ScopeInterface::SCOPE_STORE); return ($alertPriceAllow || $alertStockAllow) && parent::canShowTab(); }