Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUGFIX Only show "Roles" tab in admin/security if user has APPLY_ROLE…

…S permissions (fixes #5258) (from r101719)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@111643 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 261b4b9a6c5e504f3a2098d84b304d57bb7490ae 1 parent 6f0743f
@sminnee sminnee authored
Showing with 14 additions and 13 deletions.
  1. +14 −13 code/SecurityAdmin.php
View
27 code/SecurityAdmin.php
@@ -63,20 +63,21 @@ function getEditForm($id = null) {
)
)
);
-
- $fields->addFieldToTab(
- 'Root.Roles',
- new LiteralField(
- 'RolesAddEditLink',
- sprintf(
- '<p class="add-role"><a href="%s">%s</a></p>',
- $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(
+ '<p class="add-role"><a href="%s">%s</a></p>',
+ $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(
Please sign in to comment.
Something went wrong with that request. Please try again.