From eeb477079ee21713ff61b56a90ae5f2cd76c6ec5 Mon Sep 17 00:00:00 2001 From: Serge Gauthier Date: Fri, 22 Apr 2016 10:34:23 -0400 Subject: [PATCH] MDL-53859 competency: Can't change user in course competency breakdown --- .../lp/classes/output/user_competency_course_navigation.php | 3 ++- report/competency/classes/output/user_course_navigation.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/admin/tool/lp/classes/output/user_competency_course_navigation.php b/admin/tool/lp/classes/output/user_competency_course_navigation.php index ef40ba48e1e..3d716b5a55a 100644 --- a/admin/tool/lp/classes/output/user_competency_course_navigation.php +++ b/admin/tool/lp/classes/output/user_competency_course_navigation.php @@ -85,7 +85,8 @@ class user_competency_course_navigation implements renderable, templatable { $data->baseurl = $this->baseurl; $data->groupselector = ''; - if (has_capability('moodle/competency:coursecompetencymanage', $context)) { + if (has_any_capability(array('moodle/competency:usercompetencyview', 'moodle/competency:coursecompetencymanage'), + $context)) { $course = $DB->get_record('course', array('id' => $this->courseid)); $currentgroup = groups_get_course_group($course, true); if ($currentgroup !== false) { diff --git a/report/competency/classes/output/user_course_navigation.php b/report/competency/classes/output/user_course_navigation.php index 6b7a62b5cf5..57f27731fef 100644 --- a/report/competency/classes/output/user_course_navigation.php +++ b/report/competency/classes/output/user_course_navigation.php @@ -78,7 +78,8 @@ class user_course_navigation implements renderable, templatable { $data->baseurl = $this->baseurl; $data->groupselector = ''; - if (has_capability('moodle/competency:coursecompetencymanage', $context)) { + if (has_any_capability(array('moodle/competency:usercompetencyview', 'moodle/competency:coursecompetencymanage'), + $context)) { $course = $DB->get_record('course', array('id' => $this->courseid)); $currentgroup = groups_get_course_group($course, true); if ($currentgroup !== false) {