From e3d678f8adece711a6ccafd23e24f94fc42d594e Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Thu, 29 Oct 2009 00:55:20 +0000 Subject: [PATCH] MINOR shuffled permissions around, gave them help text and categorized them. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@90371 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/CMSMain.php | 24 ++++++++++++++---------- code/SecurityAdmin.php | 7 ++++++- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/code/CMSMain.php b/code/CMSMain.php index d2b5a3d9..fd91fd2d 100755 --- a/code/CMSMain.php +++ b/code/CMSMain.php @@ -1289,22 +1289,26 @@ JS; function providePermissions() { $classes = ClassInfo::subclassesFor('LeftAndMain'); - foreach($classes as $class) { + foreach($classes as $i => $class) { $title = _t("{$class}.MENUTITLE", LeftAndMain::menu_title_for_class($class)); - $perms["CMS_ACCESS_" . $class] = sprintf( - _t( + $perms["CMS_ACCESS_" . $class] = array( + 'name' => sprintf(_t( 'CMSMain.ACCESS', - "Access to '%s'", + "Access to %s", PR_MEDIUM, - "Item in permission selection identifying the admin section, with title and classname. Example: Access to 'Files & Images' (AssetAdmin)" - ), - $title + "Item in permission selection identifying the admin section, with title and classname. Example: Access to Files & Images" + ), $title), + 'category' => 'CMS Access' ); } - $perms["CMS_ACCESS_LeftAndMain"] = _t( - 'CMSMain.ACCESSALLINTERFACES', - 'Access to all CMS sections' + $perms["CMS_ACCESS_LeftAndMain"] = array( + 'name' => _t('CMSMain.ACCESSALLINTERFACES', 'Access to all CMS sections'), + 'category' => 'CMS Access', + 'sort' => -100 ); + + if (isset($perms['CMS_ACCESS_ModelAdmin'])) unset($perms['CMS_ACCESS_ModelAdmin']); + return $perms; } diff --git a/code/SecurityAdmin.php b/code/SecurityAdmin.php index b1f15337..054da868 100644 --- a/code/SecurityAdmin.php +++ b/code/SecurityAdmin.php @@ -262,7 +262,12 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider { function providePermissions() { return array( - 'EDIT_PERMISSIONS' => _t('SecurityAdmin.EDITPERMISSIONS', 'Manage permissions for groups'), + 'EDIT_PERMISSIONS' => array( + 'name' => _t('SecurityAdmin.EDITPERMISSIONS', 'Manage permissions for groups'), + 'category' => 'Roles and access permissions', + 'help' => 'Ability to edit Permissions and IP Addresses for a group. Requires "Access to Security".', + 'sort' => 0 + ) ); } }