mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00: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');
|
$fields->removeFieldFromTab('Root', 'IP Addresses');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Permission::check('EDIT_PERMISSIONS') && DataObject::get('PermissionRole')) {
|
if(Permission::check('APPLY_ROLES') && DataObject::get('PermissionRole')) {
|
||||||
$fields->addFieldToTab(_t('SecurityAdmin.ROLES', 'Roles'),
|
$fields->addFieldToTab('Root.' . _t('SecurityAdmin.ROLES', 'Roles'),
|
||||||
new LiteralField(
|
new LiteralField(
|
||||||
"",
|
"",
|
||||||
"<p>" .
|
"<p>" .
|
||||||
@ -112,8 +112,8 @@ class Group extends DataObject {
|
|||||||
"</p>"
|
"</p>"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
$roleData = Permission::check('ADMIN') ? DataObject::get('PermissionRole') : DataObject::get('PermissionRole', 'OnlyAdminCanApply = 0');
|
||||||
$fields->addFieldToTab(_t('SecurityAdmin.ROLES', 'Roles'), new CheckboxSetField('Roles', 'Roles', DataObject::get('PermissionRole')));
|
$fields->addFieldToTab('Root.' . _t('SecurityAdmin.ROLES', 'Roles'), new CheckboxSetField('Roles', 'Roles', $roleData));
|
||||||
}
|
}
|
||||||
|
|
||||||
$memberList->setController($this);
|
$memberList->setController($this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user