Code

Hide delete button if not allowed to delete entry
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 Jan 2007 11:22:20 +0000 (11:22 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 Jan 2007 11:22:20 +0000 (11:22 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5535 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/departments/class_divListDepartment.inc

index fb3148b99bc97925e148f95535b9e956be511628..501938ad58f74c95e062d31b517577ef77b49c34 100755 (executable)
@@ -85,14 +85,22 @@ class divListDepartment extends MultiSelectWindow
 
   function setEntries($list)
   {
-    $actions= "<input class='center' type='image' src='images/edit.png'
-      alt='"._("edit")."'   name='dep_edit_%KEY%' title='"._("Edit this entry")."'>";
-    $actions.= "<input class='center' type='image' src='images/edittrash.png'
-      alt='"._("delete")."'   name='dep_del_%KEY%' title='"._("Delete this entry")."'>";
 
     $linkopen = "<a href='?plug=".$_GET['plug']."&amp;act=dep_open&amp;dep_id=%s'>%s</a>";
 
     foreach($list as $key => $val) {
+
+      $acl= get_permissions ($val['dn'], $this->ui->subtreeACL);
+      $acl= get_module_permission($acl, "department", $val['dn']);
+
+      $actions= "<input class='center' type='image' src='images/edit.png'
+        alt='"._("edit")."'   name='dep_edit_%KEY%' title='"._("Edit this entry")."'>";
+
+      if(chkacl($acl,"delete") == ""){
+        $actions.= "<input class='center' type='image' src='images/edittrash.png'
+          alt='"._("delete")."'   name='dep_del_%KEY%' title='"._("Delete this entry")."'>";
+      }
+
       if(!isset($this->config->departments[trim($key)])){
         $this->config->departments[trim($key)]="";
       }