Skip to content

Commit

Permalink
Issue #620: use viewreport cap for downloading student certs
Browse files Browse the repository at this point in the history
  • Loading branch information
rhell4 authored and mdjnelson committed May 28, 2024
1 parent 2bdc027 commit ae137f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions view.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
}

// Check if we are downloading all certificates.
if ($downloadall && $canmanage && confirm_sesskey()) {
if ($downloadall && $canviewreport && confirm_sesskey()) {
$template = new \mod_customcert\template($template);
$issues = \mod_customcert\certificate::get_issues($customcert->id, $groupmode, $cm, 0, 0);

Expand Down Expand Up @@ -157,7 +157,7 @@
$numissues = \mod_customcert\certificate::get_number_of_issues($customcert->id, $cm, $groupmode);

$downloadallbutton = '';
if ($canmanage && $numissues > 0) {
if ($canviewreport && $numissues > 0) {
$linkname = get_string('downloadallissuedcertificates', 'customcert');
$link = new moodle_url('/mod/customcert/view.php',
[
Expand All @@ -183,7 +183,7 @@
}
echo $OUTPUT->footer($course);
exit();
} else if ($canreceive || $canmanage) { // Output to pdf.
} else if ($canreceive || $canviewreport) { // Output to pdf.
// Set the userid value of who we are downloading the certificate for.
$userid = $USER->id;
if ($downloadown) {
Expand Down

0 comments on commit ae137f3

Please sign in to comment.