当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Api2_Model_Acl_Global_Role类代码示例

本文整理汇总了PHP中Mage_Api2_Model_Acl_Global_Role的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Api2_Model_Acl_Global_Role类的具体用法?PHP Mage_Api2_Model_Acl_Global_Role怎么用?PHP Mage_Api2_Model_Acl_Global_Role使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Mage_Api2_Model_Acl_Global_Role类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _prepareCollection

 /**
  * Prepare grid collection object
  *
  * @return Mage_Api2_Block_Adminhtml_Permissions_User_Edit_Tab_Roles
  */
 protected function _prepareCollection()
 {
     /** @var $collection Mage_Api2_Model_Resource_Acl_Global_Role_Collection */
     $collection = Mage::getResourceModel('api2/acl_global_role_collection');
     $collection->addFieldToFilter('entity_id', array('nin' => Mage_Api2_Model_Acl_Global_Role::getSystemRoles()));
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:13,代码来源:Roles.php

示例2: _beforeToHtml

 /**
  * Hook before html rendering
  *
  * @return Mage_Api2_Block_Adminhtml_Roles_Tabs
  */
 protected function _beforeToHtml()
 {
     $role = $this->getRole();
     if ($role && Mage_Api2_Model_Acl_Global_Role::isSystemRole($role)) {
         $this->setActiveTab('api2_role_section_resources');
     } else {
         $this->setActiveTab('api2_role_section_info');
     }
     return parent::_beforeToHtml();
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:15,代码来源:Tabs.php

示例3: _setRules

 /**
  * Retrieve rules data from DB and inject it into ACL
  *
  * @return Mage_Api2_Model_Acl
  */
 protected function _setRules()
 {
     $resources = $this->getResources();
     /** @var Mage_Api2_Model_Resource_Acl_Global_Rule_Collection $rulesCollection */
     $rulesCollection = Mage::getResourceModel('api2/acl_global_rule_collection');
     foreach ($rulesCollection as $rule) {
         /** @var Mage_Api2_Model_Acl_Global_Rule $rule */
         if (Mage_Api2_Model_Acl_Global_Rule::RESOURCE_ALL === $rule->getResourceId()) {
             if (in_array($rule->getRoleId(), Mage_Api2_Model_Acl_Global_Role::getSystemRoles())) {
                 /** @var Mage_Api2_Model_Acl_Global_Role $role */
                 $role = $this->_getRolesCollection()->getItemById($rule->getRoleId());
                 $privileges = $this->_getConfig()->getResourceUserPrivileges($this->_resourceType, $role->getConfigNodeName());
                 if (!array_key_exists($this->_operation, $privileges)) {
                     continue;
                 }
             }
             $this->allow($rule->getRoleId());
         } elseif (in_array($rule->getResourceId(), $resources)) {
             $this->allow($rule->getRoleId(), $rule->getResourceId(), $rule->getPrivilege());
         }
     }
     return $this;
 }
开发者ID:aoepeople,项目名称:aoe_api2,代码行数:28,代码来源:Acl.php

示例4: isHidden

 /**
  * Whether tab is hidden
  *
  * @return bool
  */
 public function isHidden()
 {
     return $this->getRole() && Mage_Api2_Model_Acl_Global_Role::isSystemRole($this->getRole());
 }
开发者ID:nemphys,项目名称:magento2,代码行数:9,代码来源:Info.php

示例5: setFilterValue

 /**
  * Set filter value
  *
  * @param Mage_Api2_Model_Acl_Global_Role $role
  */
 public function setFilterValue($role)
 {
     if ($role && $role->getId()) {
         $this->_role = $role;
     }
 }
开发者ID:ravi2jdesign,项目名称:solvingmagento_1.7.0,代码行数:11,代码来源:ResourcePermission.php

示例6: getDeleteButtonHtml

 /**
  * Get delete button HTML
  *
  * @return string
  */
 public function getDeleteButtonHtml()
 {
     if (!$this->getRole() || !$this->getRole()->getId() || Mage_Api2_Model_Acl_Global_Role::isSystemRole($this->getRole())) {
         return '';
     }
     $this->getChildBlock('deleteButton')->setData('onclick', sprintf("deleteConfirm('%s', '%s')", Mage::helper('Mage_Adminhtml_Helper_Data')->__('Are you sure you want to do this?'), $this->getUrl('*/*/delete', array('id' => $this->getRole()->getId()))));
     return $this->getChildHtml('deleteButton');
 }
开发者ID:nemphys,项目名称:magento2,代码行数:13,代码来源:Buttons.php

示例7: isSystemRole

 /**
  * Get role system belonging
  *
  * @param Mage_Api2_Model_Acl_Global_Role $role
  * @return bool
  */
 public static function isSystemRole($role)
 {
     return in_array($role->getId(), self::getSystemRoles());
 }
开发者ID:SalesOneGit,项目名称:s1_magento,代码行数:10,代码来源:Role.php

示例8: getRoleUsers

 /**
  * Get users
  *
  * @param Mage_Api2_Model_Acl_Global_Role $role
  * @return array
  */
 public function getRoleUsers(Mage_Api2_Model_Acl_Global_Role $role)
 {
     $adapter = $this->_getReadAdapter();
     $select = $adapter->select()->from($this->getTable('api2/acl_user'))->where('role_id=?', $role->getId());
     $users = $adapter->fetchCol($select);
     return $users;
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:13,代码来源:Role.php

示例9: decorateUserType

 /**
  * Decorate 'User Type' column
  *
  * @param string $renderedValue Rendered value
  * @param Mage_Api2_Model_Acl_Global_Role $row
  * @param Mage_Adminhtml_Block_Widget_Grid_Column $column
  * @param bool $isExport
  * @return string
  */
 public function decorateUserType($renderedValue, $row, $column, $isExport)
 {
     switch ($row->getEntityId()) {
         case Mage_Api2_Model_Acl_Global_Role::ROLE_GUEST_ID:
             $userType = Mage::helper('api2')->__('Guest');
             break;
         case Mage_Api2_Model_Acl_Global_Role::ROLE_CUSTOMER_ID:
             $userType = Mage::helper('api2')->__('Customer');
             break;
         default:
             $userType = Mage::helper('api2')->__('Admin');
             break;
     }
     return $userType;
 }
开发者ID:SalesOneGit,项目名称:s1_magento,代码行数:24,代码来源:Grid.php


注:本文中的Mage_Api2_Model_Acl_Global_Role类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。