-
Improvement
-
Resolution: Fixed
-
Minor
-
2.6.1, 3.2
-
MOODLE_26_STABLE, MOODLE_32_STABLE
-
MOODLE_32_STABLE
-
MDL-45762-master -
Steps to reproduce
0) Log in as admin user
1) Create a test course
2) Set format to topics or weeks
3) Set course layout to one section at a time
4) Enable completion tracking
5) Add a quiz to the course and under activity completion set require grade to 'Student must receive a grade to complete this activity'
6) Edit a section and restrict access to require completion of the quiz and also set 'Before section can be accessed' to 'Show section greyed out, with restriction information'
7) Save section
8) Log in as a student (or change roll to student)
9) Manually navigate to the restricted section via the browser address bar - e.g.
http://mymoodle/course/view.php?id=100§ion=2
Instead of seeing the information about the section being restricted (e.g. "Not available until the activity solar system is marked complete.") You will instead see the following message and some debug information
"Sorry, but you do not currently have permissions to do that (View hidden sections)
More information about this error
Debug info:
Error code: nopermissions
Stack trace:
line 786 of /lib/accesslib.php: required_capability_exception thrown
line 144 of /course/view.php: call to require_capability()"