mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR create the ability to have some roles only be able to be applied by admins (from r88090)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89180 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
e9ff3f3711
commit
0c41f681b8
@ -101,8 +101,8 @@ class Group extends DataObject {
|
||||
$fields->removeFieldFromTab('Root', 'IP Addresses');
|
||||
}
|
||||
|
||||
if(Permission::check('EDIT_PERMISSIONS') && DataObject::get('PermissionRole')) {
|
||||
$fields->addFieldToTab(_t('SecurityAdmin.ROLES', 'Roles'),
|
||||
if(Permission::check('APPLY_ROLES') && DataObject::get('PermissionRole')) {
|
||||
$fields->addFieldToTab('Root.' . _t('SecurityAdmin.ROLES', 'Roles'),
|
||||
new LiteralField(
|
||||
"",
|
||||
"<p>" .
|
||||
@ -112,8 +112,8 @@ class Group extends DataObject {
|
||||
"</p>"
|
||||
)
|
||||
);
|
||||
|
||||
$fields->addFieldToTab(_t('SecurityAdmin.ROLES', 'Roles'), new CheckboxSetField('Roles', 'Roles', DataObject::get('PermissionRole')));
|
||||
$roleData = Permission::check('ADMIN') ? DataObject::get('PermissionRole') : DataObject::get('PermissionRole', 'OnlyAdminCanApply = 0');
|
||||
$fields->addFieldToTab('Root.' . _t('SecurityAdmin.ROLES', 'Roles'), new CheckboxSetField('Roles', 'Roles', $roleData));
|
||||
}
|
||||
|
||||
$memberList->setController($this);
|
||||
|
Loading…
Reference in New Issue
Block a user