From 261b4b9a6c5e504f3a2098d84b304d57bb7490ae Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Mon, 4 Oct 2010 06:09:10 +0000 Subject: [PATCH] BUGFIX Only show "Roles" tab in admin/security if user has APPLY_ROLES permissions (fixes #5258) (from r101719) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@111643 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/SecurityAdmin.php | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/code/SecurityAdmin.php b/code/SecurityAdmin.php index affc9ad5..80a6cc62 100644 --- a/code/SecurityAdmin.php +++ b/code/SecurityAdmin.php @@ -63,20 +63,21 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider { ) ) ); - - $fields->addFieldToTab( - 'Root.Roles', - new LiteralField( - 'RolesAddEditLink', - sprintf( - '

%s

', - $this->Link('show/root'), - // TODO This should include #Root_Roles to switch directly to the tab, - // but tabstrip.js doesn't display tabs when directly adressed through a URL pragma - _t('Group.RolesAddEditLink', 'Add/edit roles') + if(Permission::check('APPLY_ROLES')) { + $fields->addFieldToTab( + 'Root.Roles', + new LiteralField( + 'RolesAddEditLink', + sprintf( + '

%s

', + $this->Link('show/root'), + // TODO This should include #Root_Roles to switch directly to the tab, + // but tabstrip.js doesn't display tabs when directly adressed through a URL pragma + _t('Group.RolesAddEditLink', 'Add/edit roles') + ) ) - ) - ); + ); + } } $form->Actions()->insertBefore(