From c71ce4ba7b5e4492c62bf2f1af27e202f28ed299 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 17 Nov 2006 11:59:37 +0000 Subject: [PATCH] Only display C&P - SnapShot functionality if user has full access to current object category. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5152 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_userinfo.inc | 5 +++++ plugins/admin/groups/class_divListGroup.inc | 12 +++++++----- plugins/admin/users/class_divListUsers.inc | 17 +++++++++-------- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/include/class_userinfo.inc b/include/class_userinfo.inc index 68455e087..b057fd066 100644 --- a/include/class_userinfo.inc +++ b/include/class_userinfo.inc @@ -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: diff --git a/plugins/admin/groups/class_divListGroup.inc b/plugins/admin/groups/class_divListGroup.inc index 63062265b..13501175a 100644 --- a/plugins/admin/groups/class_divListGroup.inc +++ b/plugins/admin/groups/class_divListGroup.inc @@ -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 "  ". "  "; - 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 .= " "; @@ -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.= " "; $actions.= ""; /* 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']); } diff --git a/plugins/admin/users/class_divListUsers.inc b/plugins/admin/users/class_divListUsers.inc index 4051047f5..c6accea23 100644 --- a/plugins/admin/users/class_divListUsers.inc +++ b/plugins/admin/users/class_divListUsers.inc @@ -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 " - "; - 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 .= " "; $action.= "GetSnapShotActions($val['dn']); } -- 2.30.2