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


PHP Mage_Api2_Model_Acl_Global_Role::getSystemRoles方法代码示例

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


在下文中一共展示了Mage_Api2_Model_Acl_Global_Role::getSystemRoles方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: _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


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