From f02ab468182c1f1b135a4b5d8aedd3361d9311bf Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 25 May 2010 04:59:05 +0000 Subject: [PATCH] ENHANCEMENT Respecting SecurityAdmin::$hidden_permissions in PermissionRole->getCMSFields() MINOR Setting PermissionRole $singular_name and $plural_name (from r100771) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105647 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- security/PermissionRole.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/security/PermissionRole.php b/security/PermissionRole.php index b51122b31..907053eaf 100644 --- a/security/PermissionRole.php +++ b/security/PermissionRole.php @@ -24,18 +24,26 @@ class PermissionRole extends DataObject { static $default_sort = "\"Title\""; + static $singular_name = 'Role'; + + static $plural_name = 'Roles'; + function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeFieldFromTab('Root', 'Codes'); $fields->removeFieldFromTab('Root', 'Groups'); - $fields->addFieldToTab('Root.Main', new PermissionCheckboxSetField( - 'Codes', - singleton('Permission')->i18n_plural_name(), - 'PermissionRoleCode', - 'RoleID' - )); + $fields->addFieldToTab( + 'Root.Main', + $permissionField = new PermissionCheckboxSetField( + 'Codes', + singleton('Permission')->i18n_plural_name(), + 'PermissionRoleCode', + 'RoleID' + ) + ); + $permissionField->setHiddenPermissions(SecurityAdmin::$hidden_permissions); return $fields; }