-
Bug
-
Resolution: Fixed
-
Minor
-
2.4.4, 2.5
-
MOODLE_24_STABLE, MOODLE_25_STABLE
-
MOODLE_24_STABLE, MOODLE_25_STABLE
-
MDL-39743-master -
When viewing assignment submissions, users are given a dropdown to select numerous available actions to perform on the selected submissions. The "grant extension" option shows up regardless of the mod/assign:grantextension capability. If a user without the capability chooses the "grant extension" option, they will will be presented with the form to grant an extension, but when they submit it they will see a capability error and the extension will not be saved.
I've attached a patch file for 2.4, but it is not necessarily the "proper" way to fix it. To make this fit more into the rest of the code design, perhaps the form definition shouldn't have any capability checks, but instead call to the assignment to add the extension option if its available. eg. $assign->add_extension_elements() or something.
Patch attached as a starting point.