Moodle Switch Roles Tool
Moodle has a feature called “switch role” which allows users atwith anenough admin and instructor roleaccess to choose other typeslegacy roles (the Moodle default roles) and to view the site from the point of view of these other roles.
Basics of Switching Roles
The switch roles fromfunction allows a user with the capability moodle/role:switchroles to switch their view to that of another role. Switching to such a role is performed through a pull-down menu in the upper right corner.corner of Moodle which is visible only to those with the capability.
Switching Roles in Depth
Moodle documentation states: "New roles may not be tested using the “Switch role to…” feature." By this, it seems to imply that in actuality only the Teacher, Non-editing Teacher, Student, and Guest can accurately be tested with switch as others may include capabilities not properly reassigned when switching.
Q: Why doesn’t “Switch role to..” within a course seem to work properly for a Course Creator?
A: Thistoolfeatureenablesisthoseintendedusersfor Teachers assigned at the course level. Users assigned at “higher” contexts should not expect reliable results from this function.
* —Moodle FAQ*
Because of added capabilities for the Course Creator and Administrator roles, when changing capabilities and then reassigning them through Switch, they may not all carry over correctly. Petr Skoda writes: “We should not allow admin to viewswitch roles, because it can not work properly and also document the sitepotential asproblems awhen personuser withhas aother differentroles role.
Inabove orderthe course context because they might produce unexpected results.” (MDL-8841 & tracker.moodle.org) Some examples of where get load_all_capabilitites() fails to haveswitch accessover tocorrectly thisfrom tool,admin: youActivity mustReport, haveRestrict theActivity roleModules, ofand admin,Assign instructorRoles or teacher.control.