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