From f299327c18889790228dd56939ae986fb58e8635 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 15 Apr 2011 18:42:17 +0200 Subject: Ticket #192 - Inheritance ist nun auch berücksichtigt Group Controller fertig --- .../modules/user/controllers/GroupController.php | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'application/modules/user/controllers/GroupController.php') 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); -- cgit v1.2.3-55-g7522