MDL-38142 mod_forum: Allow viewing of student posts in hidden courses
This commit is contained in:
+1
-1
@@ -7416,7 +7416,7 @@ function forum_get_posts_by_user($user, array $courses, $musthaveaccess = false,
|
||||
|
||||
// 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)) {
|
||||
if (!can_access_course($course, $user) && !is_enrolled($coursecontext, $user)) {
|
||||
if ($musthaveaccess) {
|
||||
print_error('notenrolled', 'forum');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user