coreRegistry = $coreRegistry; $this->reviewFactory = $reviewFactory; $this->ratingFactory = $ratingFactory; parent::__construct($context); } /** * @return bool */ protected function _isAllowed() { switch ($this->getRequest()->getActionName()) { case 'pending': return $this->_authorization->isAllowed('Magento_Review::pending'); break; default: return $this->_authorization->isAllowed('Magento_Review::reviews_all'); break; } } }