MDL-76940 core_courseformat: Index refreshing when role switch
* Hidden sections and content should not visible to students when switching role
This commit is contained in:
committed by
Laurent David
parent
f49f934786
commit
ed08a4ee52
@@ -4344,6 +4344,11 @@ function role_switch($roleid, context $context) {
|
||||
load_all_capabilities();
|
||||
}
|
||||
|
||||
// Make sure that course index is refreshed.
|
||||
if ($coursecontext = $context->get_course_context()) {
|
||||
core_courseformat\base::session_cache_reset(get_course($coursecontext->instanceid));
|
||||
}
|
||||
|
||||
// Add the switch RA
|
||||
if ($roleid == 0) {
|
||||
unset($USER->access['rsw'][$context->path]);
|
||||
|
||||
Reference in New Issue
Block a user