Code

Added move create acls
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 28 May 2008 09:43:35 +0000 (09:43 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 28 May 2008 09:43:35 +0000 (09:43 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11072 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/devices/class_deviceGeneric.inc

index 099788aad5a4abc1fb1cc5e6a981da7e1ad0893d..dbef1efb1e4549259a5e4a8ff7e5bfa9524f45de 100644 (file)
@@ -5,6 +5,8 @@ class deviceGeneric extends plugin
   public $dn            = "";
   public $cn            = "";
   public $orig_cn       = "";
+  public $orig_base     = "";
+  public $orig_dn       = "";
   public $description   = "";
   public $vendor        = "";
   public $dev_id        = "";
@@ -56,6 +58,8 @@ class deviceGeneric extends plugin
     } else {
       $this->base =preg_replace ("/^[^,]+,".get_ou('deviceou')."/","",$this->dn);
     }
+    $this->orig_base = $this->base;
+    $this->orig_dn   = $this->dn;
   }
 
 
@@ -109,6 +113,14 @@ class deviceGeneric extends plugin
       }
     }
 
+    /* Check if we are allowed to create or move this object
+     */
+    if($this->orig_dn == "new" && !$this->acl_is_createable($this->base)){
+      $message[] = msgPool::permCreate();
+    }elseif($this->base != $this->orig_base && !$this->acl_is_moveable($this->base)){
+      $message[] = msgPool::permMove();
+    }
+
     return($message);
   }