mdjnelson / moodle-mod_customcert

Enables the creation of dynamically generated certificates with complete customisation via the web browser.
https://moodle.org/plugins/mod_customcert
GNU General Public License v3.0
94 stars 160 forks source link

Issue #620: use viewreport cap for downloading student certs #621

Closed rhell4 closed 6 months ago

rhell4 commented 6 months ago

As stated in issue #620 there are some inconsistencies in when the download button is shown in the report and when the user can actually download that cert, so non-editing teachers can see the buttons but get sent to a blank page. I've changed it so it consistently uses the mod/customcert:viewreport permission for downloading certificates.

If you feel like the mod/customcert:viewreport permission shouldn't allow a user to download certificates, I can adjust the change so that the mod/customcert:manage permission is required to display the download buttons in classes/report_table.php.

mdjnelson commented 6 months ago

Thanks for creating this. I agree consistency would be ideal. I just confirmed your observations with a non-editing teacher. Indeed showing them a blank page is a bug. I need to think about the solution to this for a bit.

mdjnelson commented 6 months ago

I think this approach is correct. If they can view the report then they should be able to view the certificate, viewing the certificate isnt 'managing'.

mdjnelson commented 6 months ago

Cherry-picked, cheers!