diff --git a/security/Group.php b/security/Group.php index c7d227820..92ce7f7fa 100644 --- a/security/Group.php +++ b/security/Group.php @@ -68,19 +68,9 @@ class Group extends DataObject { ), $permissionsTab = new Tab(_t('SecurityAdmin.PERMISSIONS', 'Permissions'), - new LiteralField( - "", - "
" . - _t('SecurityAdmin.ADVANCEDONLY', - "This section is for advanced users only. - See this page - for more information." - ) . - "
" - ), new PermissionCheckboxSetField( 'Permissions', - singleton('Permission')->i18n_plural_name(), + false, 'Permission', 'GroupID', $this @@ -121,6 +111,8 @@ class Group extends DataObject { $fields->removeFieldFromTab('Root', 'IP Addresses'); } + // Only show the "Roles" tab if permissions are granted to edit them, + // and at least one role exists if(Permission::check('APPLY_ROLES') && DataObject::get('PermissionRole')) { $fields->addFieldToTab('Root.' . _t('SecurityAdmin.ROLES', 'Roles'), new LiteralField(