MDL-51684 badges: Make sure 'moodle/badges:viewbadges' is respected
Credit to Yuliya Bozhko.
This commit is contained in:
committed by
Dan Poltawski
parent
d28eedd536
commit
d41fa94a69
+3
-1
@@ -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();
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
+3
-1
@@ -75,6 +75,8 @@ if ($type == BADGE_TYPE_SITE) {
|
||||
$PAGE->set_heading($title);
|
||||
}
|
||||
|
||||
require_capability('moodle/badges:viewbadges', $PAGE->context);
|
||||
|
||||
$PAGE->set_title($title);
|
||||
$output = $PAGE->get_renderer('core', 'badges');
|
||||
|
||||
@@ -103,4 +105,4 @@ if ($totalcount) {
|
||||
echo $output->notification(get_string('nobadges', 'badges'));
|
||||
}
|
||||
|
||||
echo $output->footer();
|
||||
echo $output->footer();
|
||||
|
||||
Reference in New Issue
Block a user