/** * Set filter value * * @param Mage_Api2_Model_Acl_Global_Role $role */ public function setFilterValue($role) { if ($role && $role->getId()) { $this->_role = $role; } }
/** * 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()); }
/** * Get row URL * * @param Mage_Api2_Model_Acl_Global_Role $row * @return string|null */ public function getRowUrl($row) { /** @var $session Mage_Admin_Model_Session */ $session = Mage::getSingleton('admin/session'); if ($session->isAllowed('system/api/roles/edit')) { return $this->getUrl('*/*/edit', array('id' => $row->getId())); } return null; }
/** * 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; }
/** * Get row URL * * @param Mage_Api2_Model_Acl_Global_Role $row * @return string|null */ public function getRowUrl($row) { if (Mage::getSingleton('Mage_Core_Model_Authorization')->isAllowed('Mage_Api2::rest_roles_edit')) { return $this->getUrl('*/*/edit', array('id' => $row->getId())); } return null; }