- changed title to Add "Switch role to..." in the User Menu
Add "Switch role to..." in the User Menu
Switch role has been moved in moodle 3.2 from Administration menu to User menu.
Add this item in the user menu.
Comments (22)
-
reporter -
Please add this feature.
-
Any updates on this feature?
-
reporter It is scheduled for next version 2
-
Can you tell us when it's going to be released?
-
reporter -
Hello Fernando, This functionality is essential for the teacher profile. He will have greater security to be sure of how the course is being viewed for the student.
-
I took a look at this earlier, building the url to switch role is easy enough but the "return to my normal role" also has to be added so its a bit of a pain.
I think this needs to be added before version 2 as that is some months away and this is quite fundamental functionality.
-
I have a modified version of Adaptable theme that implements the default Moodle menu to the theme. However I had to make some changes in the corerenderer.php file in order to make this work. If you guys are interested in the modified files just let me know and I'll send you a copy of it. I think we can use it until the official release with the correction come out.
-
reporter If you can create a PR for this issue then we'll review it and merge it in the future version 2. Just verify the code pass Moodle CodeChecker.
-
I think this may be the best approach, core moodle allows links to be injected into that dropdown list, the only issue is it uses pix icons and not fontawesome so users who have added links with icons may struggle a little.
-
- changed status to resolved
FIx
#586- Add "switch role to..." to the user menu→ <<cset 12b7f48709e6>>
-
I have this feature but it is a bit of a work around and needs more work.
Please see
#635which describes limitations of this fix and proposes moving code into a renderer. -
Fix
#586→ <<cset 2e6689eb627f>>
-
- changed status to open
Having to re-open this as I forgot to add a capability check to the code, as it stands students will see the links to switch role too.
-
- changed status to resolved
Fix
#586- adding capability check→ <<cset 74337dceca31>>
-
Thank you a LOT :) ;)
-
Thats ok, can you test with the latest version and let me know if its ok.
I just fixed the issues added to
#635too so it should now return you to the same page.I also added a notice to the header with "Return to my normal role" link to make it more obvious if you had switched roles.
I have also re-factored all the code for the user menu and whllst I have tested it would appreciate it if others could take a look and see if its working for them.
-
Is the role-swapping feature already available?
-
Hi Dirceu,
Yes that is in the latest version here on Bit Bucket but as this has not been released as such I would avise you test it before putting it onto a live system.
-
... you can download the latest version here: https://bitbucket.org/covuni/moodle-theme_adaptable/get/master.zip
-
Thanks, Jeremy. Good job.
- Log in to comment