From: hickert Date: Wed, 28 May 2008 09:34:03 +0000 (+0000) Subject: Updated acl checks X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bcf8cfc0e3032ad9f1aae4ade00cce5331f26316;p=gosa.git Updated acl checks git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11065 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/systems/admin/systems/class_componentGeneric.inc b/gosa-plugins/systems/admin/systems/class_componentGeneric.inc index 4fca7029c..44de99f2f 100644 --- a/gosa-plugins/systems/admin/systems/class_componentGeneric.inc +++ b/gosa-plugins/systems/admin/systems/class_componentGeneric.inc @@ -31,6 +31,8 @@ class componentGeneric extends plugin var $cn= ""; var $description= ""; var $orig_dn= ""; + var $orig_cn= ""; + var $orig_base= ""; /* attribute list for save action */ var $attributes= array("cn", "description"); @@ -53,6 +55,9 @@ class componentGeneric extends plugin $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses, true); /* Save dn for later references */ $this->orig_dn= $this->dn; + + $this->orig_base = $this->base; + $this->orig_cn = $this->cn; } @@ -235,6 +240,14 @@ class componentGeneric 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); } diff --git a/gosa-plugins/systems/admin/systems/class_servGeneric.inc b/gosa-plugins/systems/admin/systems/class_servGeneric.inc index dd5a5e2c2..cc451e006 100644 --- a/gosa-plugins/systems/admin/systems/class_servGeneric.inc +++ b/gosa-plugins/systems/admin/systems/class_servGeneric.inc @@ -33,6 +33,7 @@ class servgeneric extends plugin var $description= ""; var $orig_dn= ""; var $orig_cn= ""; + var $orig_base= ""; /* attribute list for save action */ var $attributes= array("cn", "description","gotoMode"); @@ -93,8 +94,9 @@ class servgeneric extends plugin } /* Save dn for later references */ - $this->orig_dn= $this->dn; - $this->orig_cn= $this->cn; + $this->orig_dn = $this->dn; + $this->orig_cn = $this->cn; + $this->orig_base = $this->base; } @@ -336,6 +338,14 @@ class servgeneric extends plugin CONFIRM_DIALOG); } + /* 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->cn != $this->orig_cn || $this->base != $this->orig_base && !$this->acl_is_moveable($this->base)){ + $message[] = msgPool::permMove(); + } + return ($message); }