core_enrol_get_users_courses moodle 3.5

core_enrol_get_users_courses moodle 3.5

by Chris Hawley -
Number of replies: 0

I've setup moodle web services as per the documentation and in Moodle 3.4.x this all worked, but now in Moodle 3.5.x there seems to be some additional step to get this to work. I have a syetem user who has the all the required capabilities to return data about course enrolments and I am trying to return course enrolment data on behalf of another user using their ID, however this fucntion just keeps returning an empty array webservice/rest/server.php?wstoken=xxxxxxxxxxxxxxxx&wsfunction=core_enrol_get_users_courses&moodlewsrestformat=json&userid=x even though that user is enrolled in that course. Furthermore this function webservice/rest/server.php?wstoken=xxxxxxxxxxxxxxxxxxxxxxxxxxx&wsfunction=mod_quiz_get_quizzes_by_courses&moodlewsrestformat=json&courseids[0]=x returns a warning with a message - No access rights in course context, but according to Moodle my web services user has the required capabilities to call both endpoints. Has something changed with Moodle 3.5 that means web services can no longer access data on behalf of other users without enabling some additional options or capability that isn't documented?

Average of ratings: -