Example #1
0
 /**
  * Collection object set up
  */
 protected function _prepareCollection()
 {
     $collection = new Varien_Data_Collection();
     foreach (Mage_Api2_Model_Auth_User::getUserTypes() as $type => $label) {
         $collection->addItem(new Varien_Object(array('user_type_name' => $label, 'user_type_code' => $type)));
     }
     $this->setCollection($collection);
 }
 /**
  * Edit role
  */
 public function editAction()
 {
     $this->loadLayout()->_setActiveMenu('system/services/attributes');
     $type = $this->getRequest()->getParam('type');
     $userTypes = Mage_Api2_Model_Auth_User::getUserTypes();
     if (!isset($userTypes[$type])) {
         $this->_getSession()->addError($this->__('User type "%s" not found.', $type));
         $this->_redirect('*/*/');
         return;
     }
     $this->_title($this->__('System'))->_title($this->__('Web Services'))->_title($this->__('REST ACL Attributes'));
     $title = $this->__('Edit %s ACL attribute rules', $userTypes[$type]);
     $this->_title($title);
     $this->_addBreadcrumb($title, $title);
     $this->renderLayout();
 }
Example #3
0
 /**
  * Retrieve text for header element depending on loaded page
  *
  * @return string
  */
 public function getHeaderText()
 {
     $userTypes = Mage_Api2_Model_Auth_User::getUserTypes();
     return $this->__('Edit attribute rules for %s Role', $userTypes[$this->getRequest()->getParam('type')]);
 }
 /**
  * Set filter value
  *
  * Set user type
  *
  * @param string $userType
  * @return Mage_Api2_Model_Acl_Filter_Attribute_ResourcePermission
  */
 public function setFilterValue($userType)
 {
     if (!array_key_exists($userType, Mage_Api2_Model_Auth_User::getUserTypes())) {
         throw new Exception('Unknown user type.');
     }
     $this->_userType = $userType;
     return $this;
 }