mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
MDL-8268 fixed get_user_capability_course(), patch by Mark Nielsen
This commit is contained in:
parent
89f3abc58c
commit
4fd3348637
@ -3561,7 +3561,7 @@ function get_user_capability_course($capability, $userid='') {
|
||||
$courses = get_records_select('course', '', '', 'id, id');
|
||||
|
||||
foreach ($courses as $course) {
|
||||
if (has_capability($capability, get_context_instance(CONTEXT_COURSE, $course->id))) {
|
||||
if (has_capability($capability, get_context_instance(CONTEXT_COURSE, $course->id), $userid)) {
|
||||
$usercourses[] = $course;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user