Skip to content

Commit

Permalink
MDL-17081 allow role reset to self
Browse files Browse the repository at this point in the history
The use case is importing of incomplete XML preset - keep current + preset changes. This also discards any pending changes.
  • Loading branch information
skodak committed Jun 25, 2013
1 parent 8c6b980 commit 4dd680c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions admin/roles/classes/preset_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ protected function definition() {
$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;
}

Expand Down

0 comments on commit 4dd680c

Please sign in to comment.