Code

Updated ACL checks for Applications.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 11 Nov 2008 10:22:26 +0000 (10:22 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 11 Nov 2008 10:22:26 +0000 (10:22 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13003 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/applications/class_applicationGeneric.inc

index 02cdb97b54a3fa244750ae5d23d2c09aafe4d3c8..4eb1adc362ac688c6b181194bcbc413c176c9bd8 100644 (file)
@@ -21,6 +21,8 @@ class application extends plugin
   var $orig_cn = "";
   var $orig_dn = "";
 
+  var $copy_source_dn ="";
+
   /* attribute list for save action */
   var $attributes= array("cn", "description", "gosaApplicationExecute", "gosaApplicationName","gosaApplicationIcon",
       "gosaApplicationFlags","gotoLogonScript");
@@ -458,13 +460,22 @@ class application extends plugin
     }
 
     /* Check if we are allowed to create or move this object 
+
+        Special handling if object was copied. 
+        LHM only fix. Check the acls of the source object.
+  
      */
-    if($this->orig_dn == "new" && !$this->acl_is_createable($this->base)){
-      $message[] = msgPool::permCreate();
-    }elseif($this->orig_dn != "new" && $this->base != $this->orig_base && !$this->acl_is_moveable($this->base)){
-      $message[] = msgPool::permMove();
+    if($this->copy_source_dn != ""){
+      if(!$this->acl_is_createable($this->copy_source_dn)){
+        $message[] = msgPool::permCreate();
+      }
+    }else{
+      if($this->orig_dn == "new" && !$this->acl_is_createable($this->base)){
+        $message[] = msgPool::permCreate();
+      }elseif($this->orig_dn != "new" && $this->base != $this->orig_base && !$this->acl_is_moveable($this->base)){
+        $message[] = msgPool::permMove();
+      }
     }
-
     return $message;
   }
 
@@ -588,6 +599,7 @@ class application extends plugin
   function PrepareForCopyPaste($source)
   {
     plugin::PrepareForCopyPaste($source);
+    $this->copy_source_dn = $source['dn'];
     $source_o = new application($this->config,$source['dn']);
     $this->gosaApplicationIcon = $source_o->gosaApplicationIcon;     
   }