Skip to content

Commit

Permalink
MDL-51684 badges: Make sure 'moodle/badges:viewbadges' is respected
Browse files Browse the repository at this point in the history
Credit to Yuliya Bozhko.
  • Loading branch information
David Monllao authored and danpoltawski committed Nov 4, 2015
1 parent d28eedd commit d41fa94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion badges/overview.php
Expand Up @@ -61,6 +61,8 @@
$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);

Expand All @@ -75,4 +77,4 @@
$output->print_badge_tabs($badgeid, $context, 'overview');
echo $output->print_badge_overview($badge, $context);

echo $OUTPUT->footer();
echo $OUTPUT->footer();
4 changes: 3 additions & 1 deletion badges/view.php
Expand Up @@ -75,6 +75,8 @@
$PAGE->set_heading($title);
}

require_capability('moodle/badges:viewbadges', $PAGE->context);

$PAGE->set_title($title);
$output = $PAGE->get_renderer('core', 'badges');

Expand Down Expand Up @@ -103,4 +105,4 @@
echo $output->notification(get_string('nobadges', 'badges'));
}

echo $output->footer();
echo $output->footer();

0 comments on commit d41fa94

Please sign in to comment.