Code

Added check for printer creation permissions
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 5 Sep 2006 12:27:56 +0000 (12:27 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 5 Sep 2006 12:27:56 +0000 (12:27 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4596 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_printGeneric.inc

index 8154a89ac994e9dcf1c37bbeba584b67fd4f83d8..70530282075707dded4487383d3e2f9853725207 100644 (file)
@@ -615,6 +615,16 @@ class printgeneric extends plugin
     if(($this->BelongsTo == "Printer") && (empty($this->cn))){
       $message[]= "The required field 'Printer name' is not set.";
     }
+
+    if($this->BelongsTo == "Printer"){
+      $ui= get_userinfo();
+      $acl= get_permissions ($dn, $ui->subtreeACL);
+      $acl= get_module_permission($acl, "printer", $this->dn);
+      if (chkacl($acl, "create") != ""){
+        $message[]= _("You have no permissions to create a printer on this 'Base'.");
+      }
+    }
+
     
     /* must: labeledURI */
     if(empty($this->labeledURI)){