Пример #1
0
 public function getPermissions()
 {
     if ($this->permissions == null) {
         $roleDomain = new User_Domain_Role();
         $this->permissions = $roleDomain->getPermissionsByRole($this->id);
     }
     return $this->permissions;
 }
Пример #2
0
 private function _addElementRole()
 {
     $this->addElement('select', 'acl_role_id', array('required' => true, 'label' => 'User role', 'dimension' => 6));
     $el = $this->getElement('acl_role_id');
     $roleDomain = new User_Domain_Role();
     $roles = $roleDomain->getAll(Zend_Auth::getInstance()->getIdentity()->appaccount_id);
     foreach ($roles as $r) {
         $el->addMultiOption($r->getId(), $r->getName());
     }
     if ($this->_model && $this->_model->getAcl_role_id()) {
         $el->setValue($this->_model->acl_role_id);
     }
 }
 public function listAction()
 {
     if ($this->_isUserAllowed(User_Module_Acl::ACL_RESOURCE_USERROLE, User_Module_Acl::ACL_RESOURCE_USERROLE_PRIVILEGE_CREATE)) {
         if ($this->_hasParam('id')) {
             $roleDomain = new User_Domain_Role(null);
             $role = $roleDomain->getById($this->_getParam('id'));
             if ($role) {
                 $this->view->role = $role;
                 $this->view->modulesResources = Agana_Acl_Service::getResources();
             } else {
                 $this->_helper->flashMessenger->addMessage(array('error' => 'Could not found any role with this id'));
                 return;
             }
             //$this->view->roles = $roleDomain->getAll(Zend_Auth::getInstance()->getIdentity()->appaccount_id);
         } else {
             $this->_helper->flashMessenger->addMessage(array('error' => 'Param id missing'));
             return;
         }
     }
 }
Пример #4
0
 public function listAction()
 {
     if ($this->_isUserAllowed(User_Module_Acl::ACL_RESOURCE_USERROLE, User_Module_Acl::ACL_RESOURCE_USERROLE_PRIVILEGE_LIST)) {
         $roles = new User_Domain_Role(null);
         $this->view->roles = $roles->getAll(Zend_Auth::getInstance()->getIdentity()->appaccount_id);
     }
 }
Пример #5
0
 public function getRole()
 {
     if ($this->acl_role_id && $this->role == null) {
         $roleDomain = new User_Domain_Role();
         $this->role = $roleDomain->getById($this->acl_role_id);
     }
     if (!is_a($this->role, 'User_Model_Role')) {
         $this->role = new \User_Model_Role();
     }
     return $this->role;
 }