Merge branch 'MDL-49821-master-master' of git://github.com/jleyva/moodle
[moodle.git] / notes / externallib.php
index 81a378b..944b2fb 100644 (file)
@@ -684,7 +684,7 @@ class core_notes_external extends external_api {
             $user = core_user::get_user($params['userid'], '*', MUST_EXIST);
             core_user::require_active_user($user);
 
-            if ($course->id != SITEID and !is_enrolled($context, $user, '', true)) {
+            if ($course->id != SITEID and !can_access_course($course, $user, '', true)) {
                 throw new moodle_exception('notenrolledprofile');
             }
         }