diff options
author | Björn Geiger | 2011-03-29 16:37:43 +0200 |
---|---|---|
committer | Björn Geiger | 2011-03-29 16:37:43 +0200 |
commit | 596f2dc724b1a576bbf4db118fc8648ca72801e2 (patch) | |
tree | e893bb445c5e6182e7de3549855e9767df4f78b7 /application | |
parent | RightCategories auch auf der Role Detail Seite (diff) | |
download | pbs2-596f2dc724b1a576bbf4db118fc8648ca72801e2.tar.gz pbs2-596f2dc724b1a576bbf4db118fc8648ca72801e2.tar.xz pbs2-596f2dc724b1a576bbf4db118fc8648ca72801e2.zip |
Add Right nur anzeigen, wenn nicht schon alle Rechte vorhanden
Diffstat (limited to 'application')
3 files changed, 28 insertions, 3 deletions
diff --git a/application/modules/user/controllers/PersonController.php b/application/modules/user/controllers/PersonController.php index 3d231f4..62d3b6b 100644 --- a/application/modules/user/controllers/PersonController.php +++ b/application/modules/user/controllers/PersonController.php @@ -41,6 +41,10 @@ class user_PersonController extends Zend_Controller_Action public function indexAction() { + + if(!Pbs_Acl::checkRight('psod')) { + $this->_redirect('/user'); + } $this->view->person = $this->person; $this->view->groups = $this->groups; $this->view->userIDsNamespace = Zend_Session::namespaceGet('userIDs'); @@ -48,6 +52,9 @@ class user_PersonController extends Zend_Controller_Action public function editAction() { + if(!Pbs_Acl::checkRight('peod')) { + $this->_redirect('/user'); + } $this->view->person = $this->person; if (!isset($_POST["save"])){ $editForm = new user_Form_PersonEdit(); @@ -79,6 +86,9 @@ class user_PersonController extends Zend_Controller_Action public function requestAction() { + if(!Pbs_Acl::checkRight('grm')) { + $this->_redirect('/user'); + } $this->view->person = $this->person; $allgroups = $this->groupMapper->fetchAll(); $groupRequests = $this->groupRequestMapper->findBy('personID', $this->person->getID()); @@ -141,6 +151,10 @@ class user_PersonController extends Zend_Controller_Action public function leaveAction() { + // Nicht klar welches Recht geprüft werden soll + /*if(!Pbs_Acl::checkRight('peod')) { + $this->_redirect('/user'); + }*/ $this->_helper-> viewRenderer-> setNoRender(); $this->view->person = $this->person; $membershipID = $this->_request->getParam('membershipID'); diff --git a/application/modules/user/controllers/RoleController.php b/application/modules/user/controllers/RoleController.php index 3d8e0de..dcd00ef 100644 --- a/application/modules/user/controllers/RoleController.php +++ b/application/modules/user/controllers/RoleController.php @@ -145,6 +145,12 @@ class User_RoleController extends Zend_Controller_Action } $this->view->rightcategorieslist = $rightcategorieslist; } + $rights = $this->rightMapper->fetchAll(); + if(count($rights) == count($rightroles)) { + $this->view->rightsAvailable = false; + } else { + $this->view->rightsAvailable = true; + } $this->view->role = $this->roleMapper->find($roleID); $this->view->roleID = $roleID; $this->view->userIDsNamespace = $this->userIDsNamespace; diff --git a/application/modules/user/views/scripts/role/show.phtml b/application/modules/user/views/scripts/role/show.phtml index 0a7522a..408dcc4 100644 --- a/application/modules/user/views/scripts/role/show.phtml +++ b/application/modules/user/views/scripts/role/show.phtml @@ -31,10 +31,15 @@ if($this->roleID) { </table> <br /> <h2>Rights:</h2> - <?php echo $this->formButton('linkright', 'Add Right', array( + <?php + if($this->rightsAvailable === true) { + echo $this->formButton('linkright', 'Add Right', array( 'onclick' => 'self.location="/user/role/linkright/roleID/' . $this->role->getID() .'"', 'class' => 'addbutton'))?> <br /> + <?php + } + ?> <?php if(isset($this->rightsList)) { if(isset($this->rightcategorieslist)) { foreach($this->rightcategorieslist as $k => $v) { @@ -79,6 +84,6 @@ if($this->roleID) { <center> <h3>No Rights have been added!</h3> </center> - <?php - } +<?php +} }
\ No newline at end of file |