From: hickert Date: Thu, 7 Sep 2006 04:43:32 +0000 (+0000) Subject: Added acls to department selection X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=099ec255c131477f76d90c417030551156f78d4e;p=gosa.git Added acls to department selection git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4612 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc index 582a9edc2..fb3ab679e 100644 --- a/plugins/admin/departments/class_departmentGeneric.inc +++ b/plugins/admin/departments/class_departmentGeneric.inc @@ -228,7 +228,7 @@ class department extends plugin /* Permissions for that base? */ // $this->dn= "ou=$this->ou,".$this->base; - if ($this->acl_is_createable() && $this->dn != "new"){ + if ($this->acl_is_createable() && $this->dn == "new"){ $message[]= _("You have no permissions to create a department on this 'Base'."); } diff --git a/plugins/admin/departments/class_divListDepartment.inc b/plugins/admin/departments/class_divListDepartment.inc index f83a561d1..5bb5c9d6e 100755 --- a/plugins/admin/departments/class_divListDepartment.inc +++ b/plugins/admin/departments/class_divListDepartment.inc @@ -65,17 +65,32 @@ class divListDepartment extends MultiSelectWindow } /* Generate list head */ - $listhead = "
". - "  ". - "  ". - "  ". - "  ". - "  ". - "   ". - "  ". - _("Base")." ". - "  ". - "
"; + $ui = get_userinfo(); + $acl = $ui->get_permissions("ou=dummy,",$this->selectedBase ,"department/department"); + + $listhead = "
". + "  ". + "  ". + "  ". + "  "; + + if(preg_match("/c/",$acl)){ + $listhead .= "  ". + "   "; + } + + + $listhead .= "  ". + " "._("Base")." ". + "  ". + "
"; $this->SetListHeader($listhead); } @@ -88,14 +103,24 @@ class divListDepartment extends MultiSelectWindow function setEntries($list) { - $actions= ""; - $actions.= ""; - $linkopen = "%s"; + $ui = get_userinfo(); foreach($list as $key => $val) { + + $actions= ""; + + $acl = $ui->get_permissions($this->config->departments[$key] ,"department/department"); + if(preg_match("/r/",$acl)){ + $actions.= ""; + } + + if(preg_match("/c/",$acl)){ + $actions.= ""; + } + if(!isset($this->config->departments[trim($key)])){ $this->config->departments[trim($key)]=""; }