コード例 #1
0
 /**
  * Check whether tab can be showed
  *
  * @return bool
  */
 public function canShowTab()
 {
     if (!$this->getCustomer()) {
         return false;
     }
     return $this->getCustomer()->getId() && $this->_authSession->isAllowed('Mage_Tag::tag');
 }
コード例 #2
0
 /**
  * Check whether tab can be showed
  *
  * @return bool
  */
 public function canShowTab()
 {
     return $this->_authSession->isAllowed('Mage_Tag::tag');
 }
コード例 #3
0
 /**
  * Check whether section is allowed for current user
  *
  * @return bool
  */
 public function isAllowed()
 {
     return isset($this->_data['resource']) ? $this->_authorization->isAllowed($this->_data['resource']) : false;
 }
コード例 #4
0
ファイル: Item.php プロジェクト: rorteg/magento2
 /**
  * Check whether item is allowed to the user
  *
  * @return bool
  */
 public function isAllowed()
 {
     try {
         return $this->_acl->isAllowed((string) $this->_resource);
     } catch (Exception $e) {
         return false;
     }
 }
コード例 #5
0
 public function testIsAllowedReturnNegativeValue()
 {
     $this->_policyMock->expects($this->once())->method('isAllowed')->will($this->returnValue(false));
     $this->assertFalse($this->_model->isAllowed('Mage_Module::acl_resource'));
 }
コード例 #6
0
 /**
  * Check is allow modify system configuration
  *
  * @return bool
  */
 protected function _isAllowed()
 {
     return $this->_authorization->isAllowed('Mage_Adminhtml::config');
 }