Code

Only display C&P - SnapShot functionality if user has full access to current object...
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 17 Nov 2006 11:59:37 +0000 (11:59 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 17 Nov 2006 11:59:37 +0000 (11:59 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5152 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_userinfo.inc
plugins/admin/groups/class_divListGroup.inc
plugins/admin/users/class_divListUsers.inc

index 68455e08765db4dd6345f8a8193c21a04c790bb4..b057fd0669c9f365cad69f3418aa6c3e4f2fe8d0 100644 (file)
@@ -410,6 +410,11 @@ class userinfo
     return ($acl);
   }
 
+  function has_complete_category_acls($base,$category)
+  {
+    return($this->get_permissions($base,"all/all"));
+  }
+  
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index 63062265b9a8bb69ae2d1fa3ee15edfab1355761..13501175afdd82801501d87a52452395029a7f9e 100644 (file)
@@ -105,10 +105,11 @@ class divListGroup extends MultiSelectWindow
       }
     }
 
-    $acls  = $ui->get_permissions($this->selectedBase,"groups/group");
+    $acls   = $ui->get_permissions($this->selectedBase,"groups/group");
+    $acl_all= $ui->has_complete_category_acls($this->selectedBase,"groups");
 
     /* Get copy & paste icon */
-    if(preg_match("/(c.*w|w.*c)/",$acls) &&  $this->parent->CopyPasteHandler){
+    if(preg_match("/(c.*w|w.*c)/",$acl_all) &&  $this->parent->CopyPasteHandler){
       $Copy_Paste = $this->parent->CopyPasteHandler->generatePasteIcon();
     }else{
       $Copy_Paste ="";
@@ -123,7 +124,7 @@ class divListGroup extends MultiSelectWindow
       " <input class='center' type='image' src='images/list_reload.png' align='middle' title='"._("Reload list")."' name='submit_department' alt='".        _("Submit")."'>&nbsp;".
       " <img class='center' src='images/list_seperator.png' alt='' height='16' width='1'>&nbsp;";
 
-    if(preg_match("/c/",$acls) && preg_match("/w/",$acls)){
+    if(preg_match("/(c.*w|w.*c)/",$acl_all)){
       $listhead .= $this->get_snapshot_header($this->selectedBase);
     }else{
       $listhead .= "<img class='center' src='images/restore_grey.png' alt=''>&nbsp;";
@@ -192,9 +193,10 @@ class divListGroup extends MultiSelectWindow
     
       /* Create action icons - copy & paste icons */
       $acl = $ui->get_permissions($val['dn'],"groups/group");
+      $acl_all= $ui->has_complete_category_acls($val['dn'],"groups");
 
       $actions= "";
-      if(($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl)){
+      if(($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){
         $actions.= "<input class='center' type='image'
           src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'>&nbsp;";
         $actions.= "<input class='center' type='image'
@@ -206,7 +208,7 @@ class divListGroup extends MultiSelectWindow
         src='images/edit.png' alt='"._("edit")."' name='group_edit_%KEY%' title='"._("Edit this entry")."'>";
 
       /* Add snapshot functionality */
-      if(preg_match("/(c.*w|w.*c)/", $acl)){
+      if(preg_match("/(c.*w|w.*c)/", $acl_all)){
         $actions.= $this->GetSnapShotActions($val['dn']);
       }
 
index 4051047f52268144eba93e6b43243becf8695147..c6accea237b0b0291a38ac84c6df9642236b9feb 100644 (file)
@@ -103,9 +103,10 @@ class divListUsers extends MultiSelectWindow
       }
     }
 
-    /* Get copy & paste icon */ 
-    $acl = $ui->get_permissions($this->selectedBase,"users/user");
-    if(preg_match("/(c.*w|w.*c)/",$acl) &&  $this->parent->CopyPasteHandler){
+    /* Get copy & paste icon */
+    $acl_all  = $ui->has_complete_category_acls($this->selectedBase,"users/user") ;
+    $acl      = $ui->get_permissions($this->selectedBase,"users/user");
+    if(preg_match("/(c.*w|w.*c)/",$acl_all) &&  $this->parent->CopyPasteHandler){
       $Copy_Paste = $this->parent->CopyPasteHandler->generatePasteIcon();
     }else{
       $Copy_Paste ="";
@@ -124,7 +125,7 @@ class divListUsers extends MultiSelectWindow
       " <img   class='center' src='images/list_seperator.png' align='middle' alt='-' height='16' width='1'>&nbsp;";
 
     
-    if(preg_match("/(c.*w|w.*c)/",$acl)){ 
+    if(preg_match("/(c.*w|w.*c)/",$acl_all)){ 
       $listhead .= $this->get_snapshot_header($this->selectedBase);
     }
 
@@ -242,9 +243,9 @@ class divListUsers extends MultiSelectWindow
       $action= "";
 
       /* Add copy & cut icons */     
-
-      $acl = $ui->get_permissions($val['dn'],"users/user");
-      if(preg_match("/(c.*w|w.*c)/",$acl) && $this->parent->CopyPasteHandler){
+      $acl_all  = $ui->has_complete_category_acls($this->selectedBase,"users/user") ;
+      $acl      = $ui->get_permissions($val['dn'],"users/user");
+      if(preg_match("/(c.*w|w.*c)/",$acl_all) && $this->parent->CopyPasteHandler){
         $action .= "<input class='center' type='image'
           src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'>&nbsp;";
         $action.= "<input class='center' type='image'
@@ -265,7 +266,7 @@ class divListUsers extends MultiSelectWindow
       }
 
       /* Add snapshot icon */
-      if(preg_match("/(c.*w|w.*c)/",$acl)){
+      if(preg_match("/(c.*w|w.*c)/",$acl_all)){
         $action.= $this->GetSnapShotActions($val['dn']);
       }