MDL-51684 badges: Make sure 'moodle/badges:viewbadges' is respected
authorDavid Monllao <davidm@moodle.com>
Thu, 22 Oct 2015 02:01:57 +0000 (10:01 +0800)
committerDan Poltawski <dan@moodle.com>
Wed, 4 Nov 2015 13:01:11 +0000 (13:01 +0000)
badges/overview.php

index 7801674..fa5e640 100644 (file)
@@ -61,6 +61,8 @@ $PAGE->set_heading($badge->name);
 $PAGE->set_title($badge->name);
 $PAGE->navbar->add($badge->name);
 
+require_capability('moodle/badges:viewbadges', $context);
+
 echo $OUTPUT->header();
 echo $OUTPUT->heading(print_badge_image($badge, $context, 'small') . ' ' . $badge->name);
 
@@ -75,4 +77,4 @@ echo $output->print_badge_status_box($badge);
 $output->print_badge_tabs($badgeid, $context, 'overview');
 echo $output->print_badge_overview($badge, $context);
 
-echo $OUTPUT->footer();
\ No newline at end of file
+echo $OUTPUT->footer();