]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-8268 fixed get_user_capability_course(), patch by Mark Nielsen
authorskodak <skodak>
Wed, 14 Feb 2007 22:48:11 +0000 (22:48 +0000)
committerskodak <skodak>
Wed, 14 Feb 2007 22:48:11 +0000 (22:48 +0000)
lib/accesslib.php

index 26de95fc5b8dfe13c77f503b153188ebb3f878ba..9ffe9c2c235d02444447cfb5ea3467bbedc688a3 100755 (executable)
@@ -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;
         }
     }