Code

Some acl fixes for ogroups
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Nov 2006 05:18:54 +0000 (05:18 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Nov 2006 05:18:54 +0000 (05:18 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5182 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/ogroups/class_ogroupManagement.inc
plugins/admin/systems/class_workstationStartup.inc

index 4883ecbb2074ef65356c3e1635084c04cdac2103..cdb83d0ffd6da177a0c8586dcc31c4cfab8b71c4 100644 (file)
@@ -145,7 +145,7 @@ class ogroupManagement extends plugin
 
       /* Load permissions for selected 'dn' and check if
          we're allowed to remove this 'dn' */
-      $acl = $this->ui->get_permissions($this->dn,"ogroup");
+      $acl = $this->ui->get_permissions($this->dn,"ogroups");
       if(preg_match("/d/",$acl)){
 
         /* Check locking, save current plugin in 'back_plugin', so
@@ -176,7 +176,7 @@ class ogroupManagement extends plugin
 
       /* Some nice guy may send this as POST, so we've to check
          for the permissions again. */
-      $acl = $this->ui->get_permissions($this->dn,"groups");
+      $acl = $this->ui->get_permissions($this->dn,"ogroups");
       if(preg_match("/d/",$acl)){
 
         /* Delete request is permitted, perform LDAP action */
@@ -462,16 +462,23 @@ class ogroupManagement extends plugin
       /* Copy current object to CopyHandler
        */
       if($s_action == "copy"){
+    
+
         $this->CopyPasteHandler->Clear();
         $dn       =   $this->ogrouplist[$s_entry]['dn'];
-        $obj      =   new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], $dn);
-        $objNew   =   new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], "new");
 
-        $types_of_tabs = $obj->by_object['ogroup']->gosaGroupObjects;
-        $objNew->by_object['ogroup']->gosaGroupObjects = $types_of_tabs;    
-        $objNew->reload($types_of_tabs);
+        /* Check acls */
+        $acl_all= $this->ui->has_complete_category_acls($dn,"ogroups");
+        if(preg_match("/(c.*w|w.*c)/",$acl_all)){
+          $obj      =   new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], $dn);
+          $objNew   =   new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], "new");
+
+          $types_of_tabs = $obj->by_object['ogroup']->gosaGroupObjects;
+          $objNew->by_object['ogroup']->gosaGroupObjects = $types_of_tabs;    
+          $objNew->reload($types_of_tabs);
 
-        $this->CopyPasteHandler->Copy($obj,$objNew);
+          $this->CopyPasteHandler->Copy($obj,$objNew);
+        }
       }
 
       /* Copy current object to CopyHandler
@@ -479,8 +486,13 @@ class ogroupManagement extends plugin
       if($s_action == "cut"){
         $this->CopyPasteHandler->Clear();
         $dn       =   $this->ogrouplist[$s_entry]['dn'];
-        $obj      =   new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], $dn);
-        $this->CopyPasteHandler->Cut($obj);
+
+        /* Check acls */
+        $acl_all= $this->ui->has_complete_category_acls($dn,"ogroups");
+        if(preg_match("/(c.*w|w.*c)/",$acl_all)){
+          $obj      =   new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], $dn);
+          $this->CopyPasteHandler->Cut($obj);
+        }
       }
     }
   }
index 53a2fcc88d36f3fe82936b6af866da429d04d342..8c757bcb52e20511ae756bd0ffdbe91ee7305106 100644 (file)
@@ -52,6 +52,8 @@ class workstartup extends plugin
   /* Contains all possible server/release/class settings */
   var $FAIServRepConfig   = array();
 
+  var $CopyPasteVars = array("gotoModules","gotoShares");
+
   function workstartup ($config, $dn= NULL, $parent= NULL)
   {
     plugin::plugin ($config, $dn, $parent);