Skip to content

Commit

Permalink
Merge branch 'MDL-54035_master-fix' of git://github.com/dmonllao/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Sep 26, 2018
2 parents 659d9fe + e8ce6ca commit d6b71d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/accesslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,9 @@ function reload_all_capabilities() {
foreach ($sw as $path => $roleid) {
if ($record = $DB->get_record('context', array('path'=>$path))) {
$context = context::instance_by_id($record->id);
role_switch($roleid, $context);
if (has_capability('moodle/role:switchroles', $context)) {
role_switch($roleid, $context);
}
}
}
}
Expand Down

0 comments on commit d6b71d7

Please sign in to comment.