diff options
| author | Simon | 2011-04-15 18:42:17 +0200 |
|---|---|---|
| committer | Simon | 2011-04-15 18:42:17 +0200 |
| commit | f299327c18889790228dd56939ae986fb58e8635 (patch) | |
| tree | 3581c5df8d6093850e5bf15e38888b5052b939cd /application/modules/user/controllers/GroupController.php | |
| parent | jQuery-ui angepasst, Ladebalken ist schöner (diff) | |
| download | pbs2-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.php | 24 |
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); |
