diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 5b3b1a3e491..75079441c32 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -7493,15 +7493,6 @@ function forum_get_posts_by_user($user, array $courses, $musthaveaccess = false, continue; } - // Check whether the requested user is enrolled or has access to view the course - // if they don't we immediately have a problem. - if (!can_access_course($course, $user) && !is_enrolled($coursecontext, $user)) { - if ($musthaveaccess) { - print_error('notenrolled', 'forum'); - } - continue; - } - // If groups are in use and enforced throughout the course then make sure // we can meet in at least one course level group. // Note that we check if either the current user or the requested user have