MDL-51684 badges: Make sure 'moodle/badges:viewbadges' is respected
authorYuliya Bozhko <yuliya.bozhko@totaralms.com>
Thu, 8 Oct 2015 08:29:14 +0000 (09:29 +0100)
committerDan Poltawski <dan@moodle.com>
Wed, 4 Nov 2015 13:01:11 +0000 (13:01 +0000)
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
badges/view.php

index ed0780b..ed1aa7d 100644 (file)
@@ -75,6 +75,8 @@ if ($type == BADGE_TYPE_SITE) {
     $PAGE->set_heading($coursename);
 }
 
+require_capability('moodle/badges:viewbadges', $PAGE->context);
+
 $PAGE->set_title($title);
 $output = $PAGE->get_renderer('core', 'badges');