You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is failing because the non admin users is "logged in as" a student in the course context, and the context provided to the capability check is the top level system context.
When a teacher/manager (not a site administrator) uses the Moodle "log in as" functionality to impersonate a student mod hvp activities do not appear. This is because the ajax call (http://moodle.local/mod/hvp/proxy_pluginfile.php/1/mod_hvp/cachedassets/4110b59c8092d59fd5d23b7ffc267b301637797d5.js for example) returns file not found.
This is because this capability check is failing: https://github.com/h5p/moodle-mod_hvp/blob/stable/lib.php#L268
It is failing because the non admin users is "logged in as" a student in the course context, and the context provided to the capability check is the top level system context.
This in then causing this to fail: https://github.com/moodle/moodle/blob/master/lib/accesslib.php#L528
However, as:
is set, the problematic capability check can be removed.
Removing it fixes this issue
Notes:
The text was updated successfully, but these errors were encountered: