Skip to content

Commit

Permalink
MDL-53589 badges: fix capability check
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt authored and andrewnicols committed May 6, 2016
1 parent d4f96fa commit b9cc7e0
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions badges/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,7 @@ function core_badges_myprofile_navigation(\core_user\output\myprofile\tree $tree
// Add category. This node should appear after 'contact' so that administration block appears towards the end. Refer MDL-49928.
$category = new core_user\output\myprofile\category('badges', get_string('badges', 'badges'), 'contact');
$tree->add_category($category);

// Determine context.
if (isloggedin()) {
$context = context_user::instance($USER->id);
} else {
$context = context_system::instance();
}
$context = context_user::instance($user->id);
$courseid = empty($course) ? 0 : $course->id;

if ($USER->id == $user->id || has_capability('moodle/badges:viewotherbadges', $context)) {
Expand All @@ -78,4 +72,4 @@ function core_badges_myprofile_navigation(\core_user\output\myprofile\tree $tree
}
}
}
}
}

0 comments on commit b9cc7e0

Please sign in to comment.