Code

Updated application acls
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 May 2008 13:49:00 +0000 (13:49 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 May 2008 13:49:00 +0000 (13:49 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11048 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/applications/class_applicationManagement.inc
gosa-plugins/goto/admin/applications/class_divListApplication.inc

index 7024e7991199da05e2c41791cfbdcc465f2e8075..b2a9cd44340de905b79c5de595ce65ce067154b6 100644 (file)
@@ -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");
         }
       }
index 54b9b9a06aeb37cfa5e301de1661c659ed4a250a..7c57a001d888ad8ef29b8aa27dab468ca7be2958 100644 (file)
@@ -166,10 +166,8 @@ class divListApplication extends MultiSelectWindow
       $s.= "..|---|\n";
       $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
-      if(is_object($this->parent->CopyPasteHandler) && preg_match("/(r.*d|d.*r)/",$acl_all)){
-        $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
-          "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
-      }
+      $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
+        "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
     }
 
     /* Copy & paste icons */