Skip to content

Commit

Permalink
Merge branch 'MDL-55135-master-competencies-manage-in-coursecontext' of
Browse files Browse the repository at this point in the history
  • Loading branch information
sarjona committed Feb 27, 2019
2 parents 7afeb1b + e42d429 commit 0ebfd1c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions competency/classes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -5015,8 +5015,9 @@ public static function get_least_proficient_competencies_for_course($courseid, $
static::require_enabled();
$coursecontext = context_course::instance($courseid);

if (!has_any_capability(array('moodle/competency:competencyview', 'moodle/competency:competencymanage'), $coursecontext)) {
throw new required_capability_exception($coursecontext, 'moodle/competency:competencyview', 'nopermissions', '');
if (!has_any_capability(array('moodle/competency:coursecompetencyview', 'moodle/competency:coursecompetencymanage'),
$coursecontext)) {
throw new required_capability_exception($coursecontext, 'moodle/competency:coursecompetencyview', 'nopermissions', '');
}

return user_competency_course::get_least_proficient_competencies_for_course($courseid, $skip, $limit);
Expand Down

0 comments on commit 0ebfd1c

Please sign in to comment.