mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 16:04:25 +02:00
MDL-80268 badges: require capability to view awarded badges.
This commit is contained in:
parent
ad377e3085
commit
7ace11d396
@ -54,6 +54,8 @@ $badge = new badge($badgeid);
|
||||
$context = $badge->get_context();
|
||||
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type));
|
||||
|
||||
require_capability('moodle/badges:viewawarded', $context);
|
||||
|
||||
if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
if (empty($CFG->badges_allowcoursebadges)) {
|
||||
throw new \moodle_exception('coursebadgesdisabled', 'badges');
|
||||
|
Loading…
x
Reference in New Issue
Block a user