From: hickert Date: Tue, 11 Nov 2008 10:22:26 +0000 (+0000) Subject: Updated ACL checks for Applications. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0b35d6989ec88d4f7efec222ce8b6df21fe2f3f6;p=gosa.git Updated ACL checks for Applications. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13003 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc b/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc index 02cdb97b5..4eb1adc36 100644 --- a/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc +++ b/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc @@ -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; }