From 8889e52ec6b741cfd5f47e9f71d0b4a417fa2531 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 17 Mar 2010 13:11:42 +0000 Subject: [PATCH] Updated aclRoles git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16752 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/plugins/admin/acl/acl_role.tpl | 10 +++++----- gosa-core/plugins/admin/acl/class_aclRole.inc | 8 +++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/gosa-core/plugins/admin/acl/acl_role.tpl b/gosa-core/plugins/admin/acl/acl_role.tpl index 41e2a57c6..2bb63fc82 100644 --- a/gosa-core/plugins/admin/acl/acl_role.tpl +++ b/gosa-core/plugins/admin/acl/acl_role.tpl @@ -1,6 +1,6 @@ {if $dialogState eq 'head'} -

{t}Assigned ACL for current entry{/t}

+

{t}Assigned ACL for current entry{/t}

@@ -42,13 +42,13 @@ {/if} {if $dialogState eq 'create'} -

{t}ACL type{/t}  {if $javascript eq 'false'}{/if} -

+

{t}ACL type{/t}  {if $javascript eq 'false'}{/if} +


-

{t}List of available ACL categories{/t}

+

{t}List of available ACL categories{/t}

{$aclList}
@@ -65,7 +65,7 @@ {if $dialogState eq 'edit'} -

{$headline}

+

{$headline}

{render acl=$gosaAclEntryACL} {$aclSelector} diff --git a/gosa-core/plugins/admin/acl/class_aclRole.inc b/gosa-core/plugins/admin/acl/class_aclRole.inc index a535647de..7b5aa8d00 100644 --- a/gosa-core/plugins/admin/acl/class_aclRole.inc +++ b/gosa-core/plugins/admin/acl/class_aclRole.inc @@ -393,6 +393,12 @@ class aclrole extends acl $aclList= new divSelectBox("aclList"); $aclList->SetHeight(450); + // Create a map of all used sections, this allows us to simply hide the remove button + // if no acl is configured for the given section + // e.g. ';all;department/country;users/user; + $usedList = ";".implode(array_keys($this->aclContents),';').";"; + + /* Add settings for all categories to the (permanent) list */ foreach ($this->aclObjects as $section => $dsc){ $summary= ""; @@ -423,7 +429,7 @@ class aclrole extends acl if($this->acl_is_readable("gosaAclEntry")){ $action.= image('images/lists/edit.png','cat_edit_'.$section,_("Edit category ACL")); } - if($this->acl_is_writeable("gosaAclEntry")){ + if($this->acl_is_writeable("gosaAclEntry") && preg_match("/;".$section."(;|\/)/", $usedList)){ $action.= image('images/lists/trash.png','cat_del_'.$section,_("Delete category ACL")); } -- 2.30.2