mirror of
https://github.com/moodle/moodle.git
synced 2025-08-03 08:09:47 +02:00
MDL-82390 badges: correct context check when deleting badges.
This commit is contained in:
parent
835505681c
commit
234d24dfea
1 changed files with 2 additions and 1 deletions
|
@ -107,9 +107,10 @@ if (!has_any_capability(array(
|
||||||
$PAGE->set_title($hdr);
|
$PAGE->set_title($hdr);
|
||||||
$output = $PAGE->get_renderer('core', 'badges');
|
$output = $PAGE->get_renderer('core', 'badges');
|
||||||
|
|
||||||
if (($delete || $archive) && has_capability('moodle/badges:deletebadge', $PAGE->context)) {
|
if ($delete || $archive) {
|
||||||
$badgeid = ($archive != 0) ? $archive : $delete;
|
$badgeid = ($archive != 0) ? $archive : $delete;
|
||||||
$badge = new badge($badgeid);
|
$badge = new badge($badgeid);
|
||||||
|
require_capability('moodle/badges:deletebadge', $badge->get_context());
|
||||||
if (!$confirm) {
|
if (!$confirm) {
|
||||||
echo $output->header();
|
echo $output->header();
|
||||||
// Archive this badge?
|
// Archive this badge?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue