Skip to content

Commit

Permalink
MDL-61956 calendar: allow to see hidden course with switch role
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaboesch committed May 2, 2018
1 parent 446d848 commit 0188d5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion calendar/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ public static function create($time, int $courseid, int $categoryid = null) : ca
$course = get_course($courseid);
$calendar->context = context_course::instance($course->id);

if (!$course->visible) {
if (!$course->visible && !is_role_switched($course->id)) {
require_capability('moodle/course:viewhiddencourses', $calendar->context);
}

Expand Down

0 comments on commit 0188d5b

Please sign in to comment.