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:
Petr Škoda 2013-06-25 15:15:46 +02:00
parent 8c6b980803
commit 4dd680c74e

View File

@ -52,10 +52,7 @@ class core_role_preset_form extends moodleform {
$group = get_string('role', 'core');
$options[$group] = array();
foreach (role_get_names(null, ROLENAME_BOTH) as $role) {
if ($data['roleid'] == $role->id) {
// Do not reset to self.
continue;
}
// Allow reset to self too, it may be useful when importing incomplete XML preset.
$options[$group][$role->id] = $role->localname;
}