getResources() public method

Get application resources
public getResources ( ) : array
return array
Ejemplo n.º 1
0
 public function editAction()
 {
     $role = $this->_getParam('user', false) ? $this->_helper->entity->find('Newscoop\\Entity\\User', $this->_getParam('user')) : $this->_helper->entity->find('Newscoop\\Entity\\User\\Group', $this->_getParam('group'));
     if ($this->getRequest()->isPost()) {
         $values = $this->getRequest()->getPost();
         if ($this->isBlocker($values)) {
             $this->view->error = getGS("You can't deny yourself to manage \$1", $this->getResourceName($this->resource));
             return;
         }
         try {
             $this->ruleRepository->save($values, $this->_getParam('user', false));
         } catch (\Exception $e) {
             $this->view->error = $e->getMessage();
         }
         return;
     }
     $this->view->role = $role;
     $this->view->groups = $this->groups;
     $this->view->resources = $this->resources;
     $this->view->actions = $this->acl->getResources();
     $this->view->actionNames = $this->actions;
     $this->view->acl = $this->getHelper('acl')->getAcl($role);
 }
Ejemplo n.º 2
0
 public function editAction()
 {
     $translator = \Zend_Registry::get('container')->getService('translator');
     $role = $this->_getParam('user', false) ? $this->_helper->entity->find('Newscoop\\Entity\\User', $this->_getParam('user')) : $this->_helper->entity->find('Newscoop\\Entity\\User\\Group', $this->_getParam('group'));
     if ($this->getRequest()->isPost()) {
         $values = $this->getRequest()->getPost();
         if ($this->isBlocker($values)) {
             $this->view->error = $translator->trans("You cant deny yourself to manage \$1", array('$1' => $this->getResourceName($this->resource)), 'user_types');
             return;
         }
         try {
             $this->ruleRepository->save($values, $this->_getParam('user', false));
         } catch (\Exception $e) {
             $this->view->error = $e->getMessage();
         }
         return;
     }
     $this->view->role = $role;
     $this->view->groups = $this->groups;
     $this->view->resources = $this->resources;
     $this->view->actions = $this->acl->getResources();
     $this->view->actionNames = $this->actions;
     $this->view->acl = $this->getHelper('acl')->getAcl($role);
 }