-
Bug
-
Resolution: Fixed
-
Minor
-
4.1.4
-
MOODLE_401_STABLE
-
MOODLE_401_STABLE, MOODLE_402_STABLE
-
MDL-78502-401 -
Grade export does not check for permissions before redirecting to the first export format (grade/export/index.php line 43) and results in no way for users to export grades if the first export format capability (ods) is set to not allowed (even though other formats are allowed). Users get redirected to a no permissions error with no way to change formats.
Steps to reproduce:
- Login as administrator
- Navigate to Site administration -> Users -> Permissions -> Capability overview
- Select capability: gradeexport/ods:view: Use OpenDocument grade export
and Roles: Teacher
click 'Get the overview' button - Select teacher in the table below
- On the Viewing the definition of role 'Teacher' page, press the edit button
- Go down to the 'Use OpenDocument grade export gradeexport/ods:view' capability and make sure the allow checkbox is not checked (no permission), then save changes.
- Log out of administrator account and login as a teacher
- Navigate to a course then go to grades
- In the dropdown at the top of the gradebook select 'Export'
- See the permission error message and no way to export in another format. Screenshot below.
Expected behaviour:
If the user does not have the capability to use the first export format, they should still be able to navigate to export in other formats that they do have permissions to use using the export option. Ideally it should just navigate to the next export format that the user does have permissions to view, like in the screenshot below.