From: hickert Date: Tue, 27 May 2008 13:49:00 +0000 (+0000) Subject: Updated application acls X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=08f9440cb8e9365d783f2c6d297e3820229266b8;p=gosa.git Updated application acls git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11048 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc index 7024e7991..b2a9cd443 100644 --- a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc +++ b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc @@ -317,23 +317,39 @@ class applicationManagement extends plugin if(count($ids)){ $this->dns = array(); + + $disallowed = array(); foreach($ids as $id){ - $this->dns[$id] = $this->applications[$id]['dn']; - } - if ($user= get_multiple_locks($this->dns)){ - return(gen_locked_message($user,$this->dns)); + $dn = $this->applications[$id]['dn']; + $acl = $this->ui->get_permissions($dn, "application/application"); + if(preg_match("/d/",$acl)){ + $this->dns[$id] = $dn; + }else{ + $disallowed[] = $dn; + } } - $dns_names = array(); - foreach($this->dns as $dn){ - add_lock ($dn, $this->ui->dn); - $dns_names[] =@LDAP::fix($dn); + if(count($disallowed)){ + msg_dialog::display(_("Permission"),msgPool::permDelete($disallowed),INFO_DIALOG); } - /* Lock the current entry, so nobody will edit it during deletion */ - $smarty->assign("intro", msgPool::deleteInfo($dns_names,_("application"))); - $smarty->assign("multiple", true); - return($smarty->fetch(get_template_path('remove.tpl', TRUE))); + if(count($this->dns)){ + + if ($user= get_multiple_locks($this->dns)){ + return(gen_locked_message($user,$this->dns)); + } + + $dns_names = array(); + foreach($this->dns as $dn){ + add_lock ($dn, $this->ui->dn); + $dns_names[] =@LDAP::fix($dn); + } + + /* Lock the current entry, so nobody will edit it during deletion */ + $smarty->assign("intro", msgPool::deleteInfo($dns_names,_("application"))); + $smarty->assign("multiple", true); + return($smarty->fetch(get_template_path('remove.tpl', TRUE))); + } } } @@ -579,13 +595,20 @@ class applicationManagement extends plugin return(""); } + $ui = get_userinfo(); + /* Add a single entry to queue */ if($s_action == "cut" || $s_action == "copy"){ /* Cleanup object queue */ $this->CopyPasteHandler->cleanup_queue(); $dn = $this->applications[$s_entry]['dn']; - $this->CopyPasteHandler->add_to_queue($dn,$s_action,"apptabs","APPSTABS","application"); + if($s_action == "copy" && preg_match("/r/",$ui->has_complete_category_acls($dn,"application"))){ + $this->CopyPasteHandler->add_to_queue($dn,$s_action,"apptabs","APPSTABS","application"); + } + if($s_action == "cut" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"application"))){ + $this->CopyPasteHandler->add_to_queue($dn,$s_action,"apptabs","APPSTABS","application"); + } } @@ -599,10 +622,10 @@ class applicationManagement extends plugin foreach($this->list_get_selected_items() as $id){ $dn = $this->applications[$id]['dn']; - if($s_action == "copy_multiple"){ + if($s_action == "copy_multiple" && preg_match("/r/",$ui->has_complete_category_acls($dn,"application"))){ $this->CopyPasteHandler->add_to_queue($dn,"copy","apptabs","APPSTABS","application"); } - if($s_action == "cut_multiple"){ + if($s_action == "cut_multiple" && preg_match("/(r.*d|d.*r)/",$ui->has_complete_category_acls($dn,"application"))){ $this->CopyPasteHandler->add_to_queue($dn,"cut","apptabs","APPSTABS","application"); } } diff --git a/gosa-plugins/goto/admin/applications/class_divListApplication.inc b/gosa-plugins/goto/admin/applications/class_divListApplication.inc index 54b9b9a06..7c57a001d 100644 --- a/gosa-plugins/goto/admin/applications/class_divListApplication.inc +++ b/gosa-plugins/goto/admin/applications/class_divListApplication.inc @@ -166,10 +166,8 @@ class divListApplication extends MultiSelectWindow $s.= "..|---|\n"; $s.= "..|". " "._("Copy")."|"."multiple_copy_systems|\n"; - if(is_object($this->parent->CopyPasteHandler) && preg_match("/(r.*d|d.*r)/",$acl_all)){ - $s.= "..|". - " "._("Cut")."|"."multiple_cut_systems|\n"; - } + $s.= "..|". + " "._("Cut")."|"."multiple_cut_systems|\n"; } /* Copy & paste icons */