mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-17081 allow role reset to self
The use case is importing of incomplete XML preset - keep current + preset changes. This also discards any pending changes.
This commit is contained in:
parent
8c6b980803
commit
4dd680c74e
1 changed files with 1 additions and 4 deletions
|
@ -52,10 +52,7 @@ class core_role_preset_form extends moodleform {
|
||||||
$group = get_string('role', 'core');
|
$group = get_string('role', 'core');
|
||||||
$options[$group] = array();
|
$options[$group] = array();
|
||||||
foreach (role_get_names(null, ROLENAME_BOTH) as $role) {
|
foreach (role_get_names(null, ROLENAME_BOTH) as $role) {
|
||||||
if ($data['roleid'] == $role->id) {
|
// Allow reset to self too, it may be useful when importing incomplete XML preset.
|
||||||
// Do not reset to self.
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$options[$group][$role->id] = $role->localname;
|
$options[$group][$role->id] = $role->localname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue