summaryrefslogtreecommitdiffstats
path: root/application/modules/user/controllers/GroupController.php
diff options
context:
space:
mode:
authorSimon2011-04-15 18:42:17 +0200
committerSimon2011-04-15 18:42:17 +0200
commitf299327c18889790228dd56939ae986fb58e8635 (patch)
tree3581c5df8d6093850e5bf15e38888b5052b939cd /application/modules/user/controllers/GroupController.php
parentjQuery-ui angepasst, Ladebalken ist schöner (diff)
downloadpbs2-f299327c18889790228dd56939ae986fb58e8635.tar.gz
pbs2-f299327c18889790228dd56939ae986fb58e8635.tar.xz
pbs2-f299327c18889790228dd56939ae986fb58e8635.zip
Ticket #192 - Inheritance ist nun auch berücksichtigt Group Controller fertig
Diffstat (limited to 'application/modules/user/controllers/GroupController.php')
-rw-r--r--application/modules/user/controllers/GroupController.php24
1 files changed, 18 insertions, 6 deletions
diff --git a/application/modules/user/controllers/GroupController.php b/application/modules/user/controllers/GroupController.php
index 39053ae..7a136c8 100644
--- a/application/modules/user/controllers/GroupController.php
+++ b/application/modules/user/controllers/GroupController.php
@@ -219,9 +219,6 @@ class User_GroupController extends Zend_Controller_Action
$this->view->usergroup = $this->membership->getGroupID();
$this->view->requestgroup = $groupID;
- // ACL is he allowed to see the requests of a group ?
- // TODO: THERE IS NO RIGHT TO EDIT A GROUP
- # if(Pbs_Acl::checkRight('')){
$groupRequests = $this->groupRequestMapper->findBy(array('groupID' => $groupID),true);
if(isset($groupRequests)) {
foreach($groupRequests as $groupRequest) {
@@ -234,10 +231,25 @@ class User_GroupController extends Zend_Controller_Action
if(is_array($groupRequestList)) {
$this->view->groupRequestList = $groupRequestList;
}
- // TODO: expand with al inherit roles
- $this->view->roleList = $this->rolemapper->findBy(array('groupID' => $groupID),true);
+ // Search all inherit Roles
+ $roles = array();
+ $groupGroupsMapper = new Application_Model_GroupGroupsMapper();
+ $parents = $groupGroupsMapper->getParentGroups($groupID);
+ $groupMapper = new Application_Model_GroupMapper();
+ foreach($parents as $p){
+ foreach($p as $a){
+ $group = $groupMapper->find($a);
+ if($groupID != $a)
+ $r = $this->rolemapper->findBy(array('groupID' => $a,'inheritance'=>"1"));
+ else
+ $r = $this->rolemapper->findBy(array('groupID' => $a));
+ foreach($r as $d){
+ $roles[$group->getTitle()][] = $d;
+ }
+ }
+ }
+ $this->view->roleList = $roles;
}
- # }
if(Pbs_Acl::checkRight('gsmg') || Pbs_Acl::checkRight('gsmgo')){
$members = $this->membershipMapper->findBy(array('groupID' => $groupID),true);