mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-56525 forum: remove targeted user enrolment check
By removing the check on the targeted user's enrolment we allow to show his forum posts even if he is unenrol from a course (obviouly we need to have access to this course to view them)
This commit is contained in:
parent
5ef81f2b0b
commit
feda7b3692
1 changed files with 0 additions and 9 deletions
|
@ -7493,15 +7493,6 @@ function forum_get_posts_by_user($user, array $courses, $musthaveaccess = false,
|
||||||
continue;
|
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
|
// If groups are in use and enforced throughout the course then make sure
|
||||||
// we can meet in at least one course level group.
|
// we can meet in at least one course level group.
|
||||||
// Note that we check if either the current user or the requested user have
|
// Note that we check if either the current user or the requested user have
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue