weekly release 3.4dev
[moodle.git] / lib / db / services.php
CommitLineData
9a0df45a 1<?php
9a0df45a 2// This file is part of Moodle - http://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16
a0a07014 17
9a0df45a 18/**
19 * Core external functions and service definitions.
20 *
39b90b51
EL
21 * The functions and services defined on this file are
22 * processed and registered into the Moodle DB after any
23 * install or upgrade operation. All plugins support this.
24 *
25 * For more information, take a look to the documentation available:
26 * - Webservices API: {@link http://docs.moodle.org/dev/Web_services_API}
27 * - External API: {@link http://docs.moodle.org/dev/External_functions_API}
28 * - Upgrade API: {@link http://docs.moodle.org/dev/Upgrade_API}
29 *
a0a07014
JM
30 * @package core_webservice
31 * @category webservice
32 * @copyright 2009 Petr Skodak
9a0df45a 33 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
34 */
35
36$functions = array(
83e4dc17
JL
37 'core_auth_confirm_user' => array(
38 'classname' => 'core_auth_external',
39 'methodname' => 'confirm_user',
40 'description' => 'Confirm a user account.',
41 'type' => 'write',
42 'ajax' => true,
43 'loginrequired' => false,
44 ),
b6f70a37
JL
45 'core_auth_request_password_reset' => array(
46 'classname' => 'core_auth_external',
47 'methodname' => 'request_password_reset',
48 'description' => 'Requests a password reset.',
49 'type' => 'write',
50 'ajax' => true,
51 'loginrequired' => false,
52 ),
f23e9b6b
CB
53 'core_badges_get_user_badges' => array(
54 'classname' => 'core_badges_external',
55 'methodname' => 'get_user_badges',
56 'description' => 'Returns the list of badges awarded to a user.',
57 'type' => 'read',
ee7295ee
JL
58 'capabilities' => 'moodle/badges:viewotherbadges',
59 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
088645e2 60 ),
695c5726
AN
61 'core_calendar_get_calendar_monthly_view' => array(
62 'classname' => 'core_calendar_external',
63 'methodname' => 'get_calendar_monthly_view',
64 'description' => 'Fetch the monthly view data for a calendar',
65 'classpath' => 'calendar/externallib.php',
3ea4f446
AN
66 'type' => 'read',
67 'capabilities' => '',
68 'ajax' => true,
69 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
70 ),
71 'core_calendar_get_calendar_day_view' => array(
72 'classname' => 'core_calendar_external',
73 'methodname' => 'get_calendar_day_view',
74 'description' => 'Fetch the day view data for a calendar',
75 'classpath' => 'calendar/externallib.php',
695c5726
AN
76 'type' => 'read',
77 'capabilities' => '',
78 'ajax' => true,
79 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
80 ),
e8306438
SL
81 'core_calendar_get_calendar_upcoming_view' => array(
82 'classname' => 'core_calendar_external',
83 'methodname' => 'get_calendar_upcoming_view',
84 'description' => 'Fetch the upcoming view data for a calendar',
85 'classpath' => 'calendar/externallib.php',
86 'type' => 'read',
87 'capabilities' => '',
88 'ajax' => true,
89 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
90 ),
c6fb9310
RW
91 'core_calendar_update_event_start_day' => array(
92 'classname' => 'core_calendar_external',
93 'methodname' => 'update_event_start_day',
94 'description' => 'Update the start day (but not time) for an event.',
95 'classpath' => 'calendar/externallib.php',
96 'type' => 'write',
97 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
98 'ajax' => true,
99 ),
f23e9b6b
CB
100 'core_calendar_create_calendar_events' => array(
101 'classname' => 'core_calendar_external',
102 'methodname' => 'create_calendar_events',
103 'description' => 'Create calendar events',
104 'classpath' => 'calendar/externallib.php',
105 'type' => 'write',
e453ed68
JL
106 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
107 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
088645e2 108 ),
f23e9b6b
CB
109 'core_calendar_delete_calendar_events' => array(
110 'classname' => 'core_calendar_external',
111 'methodname' => 'delete_calendar_events',
112 'description' => 'Delete calendar events',
113 'classpath' => 'calendar/externallib.php',
114 'type' => 'write',
e453ed68 115 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
542f5afa 116 'ajax' => true,
e453ed68 117 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
088645e2 118 ),
f23e9b6b
CB
119 'core_calendar_get_calendar_events' => array(
120 'classname' => 'core_calendar_external',
121 'methodname' => 'get_calendar_events',
122 'description' => 'Get calendar events',
123 'classpath' => 'calendar/externallib.php',
124 'type' => 'read',
ee7295ee
JL
125 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
126 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
088645e2 127 ),
c0f877fa
MN
128 'core_calendar_get_action_events_by_timesort' => array(
129 'classname' => 'core_calendar_external',
130 'methodname' => 'get_calendar_action_events_by_timesort',
131 'description' => 'Get calendar action events by tiemsort',
132 'classpath' => 'calendar/externallib.php',
133 'type' => 'read',
134 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
60774b28 135 'ajax' => true,
569d091b 136 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
60774b28
RW
137 ),
138 'core_calendar_get_action_events_by_course' => array(
139 'classname' => 'core_calendar_external',
140 'methodname' => 'get_calendar_action_events_by_course',
141 'description' => 'Get calendar action events by course',
142 'classpath' => 'calendar/externallib.php',
143 'type' => 'read',
144 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
9b8e5057 145 'ajax' => true,
569d091b 146 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9b8e5057
RW
147 ),
148 'core_calendar_get_action_events_by_courses' => array(
149 'classname' => 'core_calendar_external',
150 'methodname' => 'get_calendar_action_events_by_courses',
151 'description' => 'Get calendar action events by courses',
152 'classpath' => 'calendar/externallib.php',
153 'type' => 'read',
154 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
c0f877fa 155 'ajax' => true,
569d091b 156 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
c0f877fa 157 ),
5813d1b9
SL
158 'core_calendar_get_calendar_event_by_id' => array(
159 'classname' => 'core_calendar_external',
160 'methodname' => 'get_calendar_event_by_id',
161 'description' => 'Get calendar event by id',
162 'classpath' => 'calendar/externallib.php',
163 'type' => 'read',
164 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
165 'ajax' => true,
166 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
167 ),
aa091225
RW
168 'core_calendar_submit_create_update_form' => array(
169 'classname' => 'core_calendar_external',
170 'methodname' => 'submit_create_update_form',
171 'description' => 'Submit form data for event form',
172 'classpath' => 'calendar/externallib.php',
173 'type' => 'write',
174 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries',
175 'ajax' => true,
176 ),
088645e2 177 'core_cohort_add_cohort_members' => array(
f23e9b6b
CB
178 'classname' => 'core_cohort_external',
179 'methodname' => 'add_cohort_members',
180 'classpath' => 'cohort/externallib.php',
088645e2 181 'description' => 'Adds cohort members.',
f23e9b6b
CB
182 'type' => 'write',
183 'capabilities' => 'moodle/cohort:assign'
184 ),
185 'core_cohort_create_cohorts' => array(
186 'classname' => 'core_cohort_external',
187 'methodname' => 'create_cohorts',
188 'classpath' => 'cohort/externallib.php',
189 'description' => 'Creates new cohorts.',
190 'type' => 'write',
191 'capabilities' => 'moodle/cohort:manage'
088645e2 192 ),
088645e2 193 'core_cohort_delete_cohort_members' => array(
f23e9b6b
CB
194 'classname' => 'core_cohort_external',
195 'methodname' => 'delete_cohort_members',
196 'classpath' => 'cohort/externallib.php',
088645e2 197 'description' => 'Deletes cohort members.',
0a4f3eb2 198 'type' => 'write',
f23e9b6b
CB
199 'capabilities' => 'moodle/cohort:assign'
200 ),
201 'core_cohort_delete_cohorts' => array(
202 'classname' => 'core_cohort_external',
203 'methodname' => 'delete_cohorts',
204 'classpath' => 'cohort/externallib.php',
205 'description' => 'Deletes all specified cohorts.',
0a4f3eb2 206 'type' => 'write',
f23e9b6b 207 'capabilities' => 'moodle/cohort:manage'
088645e2 208 ),
088645e2 209 'core_cohort_get_cohort_members' => array(
f23e9b6b
CB
210 'classname' => 'core_cohort_external',
211 'methodname' => 'get_cohort_members',
212 'classpath' => 'cohort/externallib.php',
088645e2 213 'description' => 'Returns cohort members.',
f23e9b6b
CB
214 'type' => 'read',
215 'capabilities' => 'moodle/cohort:view'
e77a0f36 216 ),
a60e8ba5
DW
217 'core_cohort_search_cohorts' => array(
218 'classname' => 'core_cohort_external',
219 'methodname' => 'search_cohorts',
220 'classpath' => 'cohort/externallib.php',
221 'description' => 'Search for cohorts.',
222 'type' => 'read',
223 'ajax' => true,
224 'capabilities' => 'moodle/cohort:view'
225 ),
f23e9b6b
CB
226 'core_cohort_get_cohorts' => array(
227 'classname' => 'core_cohort_external',
228 'methodname' => 'get_cohorts',
229 'classpath' => 'cohort/externallib.php',
230 'description' => 'Returns cohort details.',
231 'type' => 'read',
232 'capabilities' => 'moodle/cohort:view'
d3549931 233 ),
f23e9b6b
CB
234 'core_cohort_update_cohorts' => array(
235 'classname' => 'core_cohort_external',
236 'methodname' => 'update_cohorts',
237 'classpath' => 'cohort/externallib.php',
238 'description' => 'Updates existing cohorts.',
239 'type' => 'write',
240 'capabilities' => 'moodle/cohort:manage'
d3549931 241 ),
f23e9b6b
CB
242 'core_comment_get_comments' => array(
243 'classname' => 'core_comment_external',
244 'methodname' => 'get_comments',
245 'description' => 'Returns comments.',
246 'type' => 'read',
ee7295ee
JL
247 'capabilities' => 'moodle/comment:view',
248 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 249 ),
f23e9b6b
CB
250 'core_completion_get_activities_completion_status' => array(
251 'classname' => 'core_completion_external',
252 'methodname' => 'get_activities_completion_status',
253 'description' => 'Return the activities completion status for a user in a course.',
254 'type' => 'read',
ee7295ee 255 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9a0df45a 256 ),
f23e9b6b
CB
257 'core_completion_get_course_completion_status' => array(
258 'classname' => 'core_completion_external',
259 'methodname' => 'get_course_completion_status',
260 'description' => 'Returns course completion status.',
261 'type' => 'read',
ee7295ee
JL
262 'capabilities' => 'report/completion:view',
263 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 264 ),
f23e9b6b
CB
265 'core_completion_mark_course_self_completed' => array(
266 'classname' => 'core_completion_external',
267 'methodname' => 'mark_course_self_completed',
268 'description' => 'Update the course completion status for the current user (if course self-completion is enabled).',
269 'type' => 'write',
ee7295ee 270 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9a0df45a 271 ),
f23e9b6b
CB
272 'core_completion_update_activity_completion_status_manually' => array(
273 'classname' => 'core_completion_external',
274 'methodname' => 'update_activity_completion_status_manually',
275 'description' => 'Update completion status for the current user in an activity, only for activities with manual tracking.',
276 'type' => 'write',
ee7295ee 277 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 278 ),
f23e9b6b
CB
279 'core_course_create_categories' => array(
280 'classname' => 'core_course_external',
281 'methodname' => 'create_categories',
282 'classpath' => 'course/externallib.php',
283 'description' => 'Create course categories',
284 'type' => 'write',
285 'capabilities' => 'moodle/category:manage'
246f6da2 286 ),
f23e9b6b
CB
287 'core_course_create_courses' => array(
288 'classname' => 'core_course_external',
289 'methodname' => 'create_courses',
290 'classpath' => 'course/externallib.php',
291 'description' => 'Create new courses',
292 'type' => 'write',
293 'capabilities' => 'moodle/course:create, moodle/course:visibility'
5d1017e1 294 ),
f23e9b6b
CB
295 'core_course_delete_categories' => array(
296 'classname' => 'core_course_external',
297 'methodname' => 'delete_categories',
298 'classpath' => 'course/externallib.php',
299 'description' => 'Delete course categories',
300 'type' => 'write',
301 'capabilities' => 'moodle/category:manage'
9a0df45a 302 ),
f23e9b6b
CB
303 'core_course_delete_courses' => array(
304 'classname' => 'core_course_external',
305 'methodname' => 'delete_courses',
306 'classpath' => 'course/externallib.php',
307 'description' => 'Deletes all specified courses',
308 'type' => 'write',
309 'capabilities' => 'moodle/course:delete'
5d1017e1 310 ),
f23e9b6b
CB
311 'core_course_delete_modules' => array(
312 'classname' => 'core_course_external',
313 'methodname' => 'delete_modules',
314 'classpath' => 'course/externallib.php',
315 'description' => 'Deletes all specified module instances',
316 'type' => 'write',
317 'capabilities' => 'moodle/course:manageactivities'
9a0df45a 318 ),
f23e9b6b
CB
319 'core_course_duplicate_course' => array(
320 'classname' => 'core_course_external',
321 'methodname' => 'duplicate_course',
322 'classpath' => 'course/externallib.php',
67adb4d8 323 'description' => 'Duplicate an existing course (creating a new one).',
f23e9b6b
CB
324 'type' => 'write',
325 'capabilities' => 'moodle/backup:backupcourse, moodle/restore:restorecourse, moodle/course:create'
5d1017e1 326 ),
f23e9b6b
CB
327 'core_course_get_categories' => array(
328 'classname' => 'core_course_external',
329 'methodname' => 'get_categories',
330 'classpath' => 'course/externallib.php',
331 'description' => 'Return category details',
332 'type' => 'read',
331e038b
JL
333 'capabilities' => 'moodle/category:viewhiddencategories',
334 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9a0df45a 335 ),
f23e9b6b
CB
336 'core_course_get_contents' => array(
337 'classname' => 'core_course_external',
338 'methodname' => 'get_course_contents',
339 'classpath' => 'course/externallib.php',
340 'description' => 'Get course contents',
341 'type' => 'read',
ee7295ee
JL
342 'capabilities' => 'moodle/course:update, moodle/course:viewhiddencourses',
343 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9a0df45a 344 ),
f23e9b6b
CB
345 'core_course_get_course_module' => array(
346 'classname' => 'core_course_external',
347 'methodname' => 'get_course_module',
348 'classpath' => 'course/externallib.php',
349 'description' => 'Return information about a course module',
350 'type' => 'read',
ee7295ee 351 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 352 ),
f23e9b6b
CB
353 'core_course_get_course_module_by_instance' => array(
354 'classname' => 'core_course_external',
355 'methodname' => 'get_course_module_by_instance',
356 'classpath' => 'course/externallib.php',
357 'description' => 'Return information about a given module name and instance id',
358 'type' => 'read',
ee7295ee 359 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
7ce23590 360 ),
4529327a
MG
361 'core_course_get_module' => array(
362 'classname' => 'core_course_external',
363 'methodname' => 'get_module',
364 'classpath' => 'course/externallib.php',
365 'description' => 'Returns html with one activity module on course page',
366 'type' => 'read',
367 'ajax' => true,
368 ),
369 'core_course_edit_module' => array(
370 'classname' => 'core_course_external',
371 'methodname' => 'edit_module',
372 'classpath' => 'course/externallib.php',
373 'description' => 'Performs an action on course module (change visibility, duplicate, delete, etc.)',
374 'type' => 'write',
375 'ajax' => true,
376 ),
377 'core_course_edit_section' => array(
378 'classname' => 'core_course_external',
379 'methodname' => 'edit_section',
380 'classpath' => 'course/externallib.php',
381 'description' => 'Performs an action on course section (change visibility, set marker, delete)',
382 'type' => 'write',
383 'ajax' => true,
384 ),
f23e9b6b
CB
385 'core_course_get_courses' => array(
386 'classname' => 'core_course_external',
387 'methodname' => 'get_courses',
388 'classpath' => 'course/externallib.php',
389 'description' => 'Return course details',
390 'type' => 'read',
391 'capabilities' => 'moodle/course:view, moodle/course:update, moodle/course:viewhiddencourses',
5041600d 392 'ajax' => true,
ee7295ee 393 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
7ce23590 394 ),
f23e9b6b
CB
395 'core_course_import_course' => array(
396 'classname' => 'core_course_external',
397 'methodname' => 'import_course',
398 'classpath' => 'course/externallib.php',
399 'description' => 'Import course data from a course into another course. Does not include any user data.',
400 'type' => 'write',
401 'capabilities' => 'moodle/backup:backuptargetimport, moodle/restore:restoretargetimport'
7ce23590 402 ),
f23e9b6b
CB
403 'core_course_search_courses' => array(
404 'classname' => 'core_course_external',
405 'methodname' => 'search_courses',
406 'classpath' => 'course/externallib.php',
407 'description' => 'Search courses by (name, module, block, tag)',
408 'type' => 'read',
5041600d 409 'ajax' => true,
ee7295ee 410 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
7ce23590 411 ),
f23e9b6b
CB
412 'core_course_update_categories' => array(
413 'classname' => 'core_course_external',
414 'methodname' => 'update_categories',
415 'classpath' => 'course/externallib.php',
416 'description' => 'Update categories',
417 'type' => 'write',
418 'capabilities' => 'moodle/category:manage',
7ce23590 419 ),
f23e9b6b
CB
420 'core_course_update_courses' => array(
421 'classname' => 'core_course_external',
422 'methodname' => 'update_courses',
423 'classpath' => 'course/externallib.php',
424 'description' => 'Update courses',
425 'type' => 'write',
426 'capabilities' => 'moodle/course:update, moodle/course:changecategory, moodle/course:changefullname, '
427 . 'moodle/course:changeshortname, moodle/course:changeidnumber, moodle/course:changesummary, moodle/course:visibility'
7ce23590 428 ),
f23e9b6b
CB
429 'core_course_view_course' => array(
430 'classname' => 'core_course_external',
431 'methodname' => 'view_course',
432 'classpath' => 'course/externallib.php',
433 'description' => 'Log that the course was viewed',
434 'type' => 'write',
ee7295ee 435 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
7ce23590 436 ),
7c4e686f
JL
437 'core_course_get_activities_overview' => array(
438 'classname' => 'core_course_external',
439 'methodname' => 'get_activities_overview',
440 'classpath' => 'course/externallib.php',
e9dfeec9
MN
441 'description' => '** DEPRECATED ** Please do not call this function any more.
442 Return activities overview for the given courses.',
7c4e686f
JL
443 'type' => 'read',
444 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
445 ),
c115ff6a
JL
446 'core_course_get_user_navigation_options' => array(
447 'classname' => 'core_course_external',
448 'methodname' => 'get_user_navigation_options',
449 'classpath' => 'course/externallib.php',
450 'description' => 'Return a list of navigation options in a set of courses that are avaialable or not for the current user.',
451 'type' => 'read',
452 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
453 ),
b9050b10
JL
454 'core_course_get_user_administration_options' => array(
455 'classname' => 'core_course_external',
456 'methodname' => 'get_user_administration_options',
457 'classpath' => 'course/externallib.php',
458 'description' => 'Return a list of administration options in a set of courses that are avaialable or not for the current
459 user.',
460 'type' => 'read',
461 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
462 ),
80adabef
JL
463 'core_course_get_courses_by_field' => array(
464 'classname' => 'core_course_external',
465 'methodname' => 'get_courses_by_field',
466 'classpath' => 'course/externallib.php',
467 'description' => 'Get courses matching a specific field (id/s, shortname, idnumber, category)',
468 'type' => 'read',
469 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
470 ),
26659f62
JL
471 'core_course_check_updates' => array(
472 'classname' => 'core_course_external',
473 'methodname' => 'check_updates',
474 'classpath' => 'course/externallib.php',
475 'description' => 'Check if there is updates affecting the user for the given course and contexts.',
476 'type' => 'read',
477 'ajax' => true,
478 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
479 ),
879a8f56
JL
480 'core_course_get_updates_since' => array(
481 'classname' => 'core_course_external',
482 'methodname' => 'get_updates_since',
483 'classpath' => 'course/externallib.php',
484 'description' => 'Check if there are updates affecting the user for the given course since the given time stamp.',
485 'type' => 'read',
486 'ajax' => true,
487 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
488 ),
f23e9b6b
CB
489 'core_enrol_get_course_enrolment_methods' => array(
490 'classname' => 'core_enrol_external',
491 'methodname' => 'get_course_enrolment_methods',
492 'classpath' => 'enrol/externallib.php',
493 'description' => 'Get the list of course enrolment methods',
494 'type' => 'read',
ee7295ee 495 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d62e813 496 ),
f23e9b6b
CB
497 'core_enrol_get_enrolled_users' => array(
498 'classname' => 'core_enrol_external',
499 'methodname' => 'get_enrolled_users',
500 'classpath' => 'enrol/externallib.php',
501 'description' => 'Get enrolled users by course id.',
502 'type' => 'read',
503 'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, '
ee7295ee
JL
504 . 'moodle/site:accessallgroups',
505 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
7107c2f0 506 ),
f23e9b6b
CB
507 'core_enrol_get_enrolled_users_with_capability' => array(
508 'classname' => 'core_enrol_external',
509 'methodname' => 'get_enrolled_users_with_capability',
510 'classpath' => 'enrol/externallib.php',
511 'description' => 'For each course and capability specified, return a list of the users that are enrolled in the course
512 and have that capability',
513 'type' => 'read',
c0ef63eb 514 ),
a60e8ba5
DW
515 'core_enrol_get_potential_users' => array(
516 'classname' => 'core_enrol_external',
517 'methodname' => 'get_potential_users',
518 'classpath' => 'enrol/externallib.php',
519 'description' => 'Get the list of potential users to enrol',
0fa35b1a 520 'ajax' => true,
a60e8ba5
DW
521 'type' => 'read',
522 'capabilities' => 'moodle/course:enrolreview'
523 ),
f23e9b6b
CB
524 'core_enrol_get_users_courses' => array(
525 'classname' => 'core_enrol_external',
526 'methodname' => 'get_users_courses',
527 'classpath' => 'enrol/externallib.php',
528 'description' => 'Get the list of courses where a user is enrolled in',
529 'type' => 'read',
ee7295ee
JL
530 'capabilities' => 'moodle/course:viewparticipants',
531 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9857381d 532 ),
58c20c81
JP
533 'core_enrol_edit_user_enrolment' => array(
534 'classname' => 'core_enrol_external',
535 'methodname' => 'edit_user_enrolment',
536 'classpath' => 'enrol/externallib.php',
537 'description' => 'External function that updates a given user enrolment',
538 'type' => 'write',
539 'ajax' => true,
540 ),
f23e9b6b
CB
541 'core_fetch_notifications' => array(
542 'classname' => 'core_external',
543 'methodname' => 'fetch_notifications',
544 'classpath' => 'lib/external/externallib.php',
545 'description' => 'Return a list of notifications for the current session',
546 'type' => 'read',
5041600d
RT
547 'loginrequired' => false,
548 'ajax' => true,
5d1017e1 549 ),
5d1017e1 550 'core_files_get_files' => array(
f23e9b6b
CB
551 'classname' => 'core_files_external',
552 'methodname' => 'get_files',
249c4f60 553 'description' => 'browse moodle files',
f23e9b6b
CB
554 'type' => 'read',
555 'classpath' => 'files/externallib.php',
ee7295ee 556 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 557 ),
5d1017e1 558 'core_files_upload' => array(
f23e9b6b
CB
559 'classname' => 'core_files_external',
560 'methodname' => 'upload',
249c4f60
DC
561 'description' => 'upload a file to moodle',
562 'type' => 'write',
563 'classpath' => 'files/externallib.php',
564 ),
8b493eb0
DM
565 'core_form_get_filetypes_browser_data' => array(
566 'classname' => 'core_form\external',
567 'methodname' => 'get_filetypes_browser_data',
568 'classpath' => '',
569 'description' => 'Provides data for the filetypes element browser.',
570 'type' => 'read',
571 'loginrequired' => false,
572 'ajax' => true,
573 ),
f23e9b6b
CB
574 'core_get_component_strings' => array(
575 'classname' => 'core_external',
576 'methodname' => 'get_component_strings',
577 'classpath' => 'lib/external/externallib.php',
faeca20d
DM
578 'description' => 'Return all raw strings (with {$a->xxx}), for a specific component ' .
579 '- similar to core get_component_strings(), call',
f23e9b6b 580 'type' => 'read',
5041600d
RT
581 'loginrequired' => false,
582 'ajax' => true,
ee7295ee 583 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
3364dbb5 584 ),
f23e9b6b
CB
585 'core_get_fragment' => array(
586 'classname' => 'core_external',
587 'methodname' => 'get_fragment',
588 'classpath' => 'lib/external/externallib.php',
589 'description' => 'Return a fragment for inclusion, such as a JavaScript page.',
590 'type' => 'read',
5041600d 591 'ajax' => true,
5d1017e1 592 ),
f23e9b6b
CB
593 'core_get_string' => array(
594 'classname' => 'core_external',
595 'methodname' => 'get_string',
596 'classpath' => 'lib/external/externallib.php',
597 'description' => 'Return a translated string - similar to core get_string(), call',
598 'type' => 'read',
5041600d
RT
599 'loginrequired' => false,
600 'ajax' => true,
be9bf94e 601 ),
f23e9b6b
CB
602 'core_get_strings' => array(
603 'classname' => 'core_external',
604 'methodname' => 'get_strings',
605 'classpath' => 'lib/external/externallib.php',
606 'description' => 'Return some translated strings - like several core get_string(), calls',
607 'type' => 'read',
5041600d
RT
608 'loginrequired' => false,
609 'ajax' => true,
5d1017e1 610 ),
88c2941b
RW
611 'core_get_user_dates' => array(
612 'classname' => 'core_external',
613 'methodname' => 'get_user_dates',
614 'classpath' => 'lib/external/externallib.php',
615 'description' => 'Return formatted timestamps',
616 'type' => 'read',
617 'ajax' => true,
618 ),
f23e9b6b
CB
619 'core_grades_get_grades' => array(
620 'classname' => 'core_grades_external',
621 'methodname' => 'get_grades',
aa7e371a
JL
622 'description' => '** DEPRECATED ** Please do not call this function any more.
623 Returns student course total grade and grades for activities.
f23e9b6b
CB
624 This function does not return category or manual items.
625 This function is suitable for managers or teachers not students.',
626 'type' => 'read',
627 'capabilities' => 'moodle/grade:view, moodle/grade:viewall, moodle/grade:viewhidden'
e9b66095 628 ),
f23e9b6b
CB
629 'core_grades_update_grades' => array(
630 'classname' => 'core_grades_external',
631 'methodname' => 'update_grades',
632 'description' => 'Update a grade item and associated student grades.',
633 'type' => 'write',
5d1017e1 634 ),
f23e9b6b
CB
635 'core_grading_get_definitions' => array(
636 'classname' => 'core_grading_external',
637 'methodname' => 'get_definitions',
638 'description' => 'Get grading definitions',
639 'type' => 'read',
e9b66095 640 ),
f23e9b6b
CB
641 'core_grading_get_gradingform_instances' => array(
642 'classname' => 'core_grading_external',
643 'methodname' => 'get_gradingform_instances',
644 'description' => 'Get grading form instances',
645 'type' => 'read',
f2229c68 646 ),
f23e9b6b
CB
647 'core_grading_save_definitions' => array(
648 'classname' => 'core_grading_external',
649 'methodname' => 'save_definitions',
650 'description' => 'Save grading definitions',
651 'type' => 'write',
5d1017e1 652 ),
f23e9b6b
CB
653 'core_group_add_group_members' => array(
654 'classname' => 'core_group_external',
655 'methodname' => 'add_group_members',
656 'classpath' => 'group/externallib.php',
657 'description' => 'Adds group members.',
658 'type' => 'write',
659 'capabilities' => 'moodle/course:managegroups',
6bb31e40 660 ),
f23e9b6b
CB
661 'core_group_assign_grouping' => array(
662 'classname' => 'core_group_external',
663 'methodname' => 'assign_grouping',
664 'classpath' => 'group/externallib.php',
665 'description' => 'Assing groups from groupings',
666 'type' => 'write',
740c354f 667 ),
f23e9b6b
CB
668 'core_group_create_groupings' => array(
669 'classname' => 'core_group_external',
670 'methodname' => 'create_groupings',
671 'classpath' => 'group/externallib.php',
672 'description' => 'Creates new groupings',
673 'type' => 'write',
5d1017e1 674 ),
f23e9b6b
CB
675 'core_group_create_groups' => array(
676 'classname' => 'core_group_external',
677 'methodname' => 'create_groups',
678 'classpath' => 'group/externallib.php',
679 'description' => 'Creates new groups.',
680 'type' => 'write',
681 'capabilities' => 'moodle/course:managegroups'
6bb31e40 682 ),
f23e9b6b
CB
683 'core_group_delete_group_members' => array(
684 'classname' => 'core_group_external',
685 'methodname' => 'delete_group_members',
686 'classpath' => 'group/externallib.php',
687 'description' => 'Deletes group members.',
0a4f3eb2 688 'type' => 'write',
f23e9b6b 689 'capabilities' => 'moodle/course:managegroups'
63a85dc7 690 ),
f23e9b6b
CB
691 'core_group_delete_groupings' => array(
692 'classname' => 'core_group_external',
693 'methodname' => 'delete_groupings',
694 'classpath' => 'group/externallib.php',
695 'description' => 'Deletes all specified groupings.',
79949c1b 696 'type' => 'write',
79949c1b 697 ),
f23e9b6b
CB
698 'core_group_delete_groups' => array(
699 'classname' => 'core_group_external',
700 'methodname' => 'delete_groups',
701 'classpath' => 'group/externallib.php',
702 'description' => 'Deletes all specified groups.',
0a4f3eb2 703 'type' => 'write',
f23e9b6b 704 'capabilities' => 'moodle/course:managegroups'
3dc1d76e 705 ),
f23e9b6b
CB
706 'core_group_get_activity_allowed_groups' => array(
707 'classname' => 'core_group_external',
708 'methodname' => 'get_activity_allowed_groups',
709 'classpath' => 'group/externallib.php',
710 'description' => 'Gets a list of groups that the user is allowed to access within the specified activity.',
711 'type' => 'read',
ee7295ee 712 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
791723c3 713 ),
f23e9b6b
CB
714 'core_group_get_activity_groupmode' => array(
715 'classname' => 'core_group_external',
716 'methodname' => 'get_activity_groupmode',
717 'classpath' => 'group/externallib.php',
718 'description' => 'Returns effective groupmode used in a given activity.',
719 'type' => 'read',
ee7295ee 720 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
c4f7bf29 721 ),
f23e9b6b
CB
722 'core_group_get_course_groupings' => array(
723 'classname' => 'core_group_external',
724 'methodname' => 'get_course_groupings',
725 'classpath' => 'group/externallib.php',
726 'description' => 'Returns all groupings in specified course.',
727 'type' => 'read',
c5158499 728 ),
f23e9b6b
CB
729 'core_group_get_course_groups' => array(
730 'classname' => 'core_group_external',
731 'methodname' => 'get_course_groups',
732 'classpath' => 'group/externallib.php',
733 'description' => 'Returns all groups in specified course.',
734 'type' => 'read',
735 'capabilities' => 'moodle/course:managegroups'
13bb6819 736 ),
f23e9b6b
CB
737 'core_group_get_course_user_groups' => array(
738 'classname' => 'core_group_external',
739 'methodname' => 'get_course_user_groups',
740 'classpath' => 'group/externallib.php',
741 'description' => 'Returns all groups in specified course for the specified user.',
742 'type' => 'read',
ee7295ee
JL
743 'capabilities' => 'moodle/course:managegroups',
744 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
3ec163dd 745 ),
f23e9b6b
CB
746 'core_group_get_group_members' => array(
747 'classname' => 'core_group_external',
748 'methodname' => 'get_group_members',
749 'classpath' => 'group/externallib.php',
750 'description' => 'Returns group members.',
751 'type' => 'read',
752 'capabilities' => 'moodle/course:managegroups'
479a5db1 753 ),
f23e9b6b
CB
754 'core_group_get_groupings' => array(
755 'classname' => 'core_group_external',
756 'methodname' => 'get_groupings',
757 'classpath' => 'group/externallib.php',
758 'description' => 'Returns groupings details.',
759 'type' => 'read',
3ec163dd 760 ),
f23e9b6b
CB
761 'core_group_get_groups' => array(
762 'classname' => 'core_group_external',
763 'methodname' => 'get_groups',
764 'classpath' => 'group/externallib.php',
765 'description' => 'Returns group details.',
766 'type' => 'read',
767 'capabilities' => 'moodle/course:managegroups'
2f951d86 768 ),
f23e9b6b
CB
769 'core_group_unassign_grouping' => array(
770 'classname' => 'core_group_external',
771 'methodname' => 'unassign_grouping',
772 'classpath' => 'group/externallib.php',
773 'description' => 'Unassing groups from groupings',
774 'type' => 'write',
8430d87b 775 ),
f23e9b6b
CB
776 'core_group_update_groupings' => array(
777 'classname' => 'core_group_external',
778 'methodname' => 'update_groupings',
779 'classpath' => 'group/externallib.php',
780 'description' => 'Updates existing groupings',
781 'type' => 'write',
5d1017e1 782 ),
f23e9b6b
CB
783 'core_message_block_contacts' => array(
784 'classname' => 'core_message_external',
785 'methodname' => 'block_contacts',
786 'classpath' => 'message/externallib.php',
787 'description' => 'Block contacts',
788 'type' => 'write',
c6e97f54 789 'ajax' => true,
ee7295ee 790 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
a623b6b8 791 ),
d6731600 792 'core_message_create_contacts' => array(
f23e9b6b
CB
793 'classname' => 'core_message_external',
794 'methodname' => 'create_contacts',
795 'classpath' => 'message/externallib.php',
d6731600 796 'description' => 'Add contacts to the contact list',
f23e9b6b 797 'type' => 'write',
c6e97f54 798 'ajax' => true,
ee7295ee 799 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
12d8c7b2 800 'ajax' => true,
d6731600 801 ),
d6731600 802 'core_message_delete_contacts' => array(
f23e9b6b
CB
803 'classname' => 'core_message_external',
804 'methodname' => 'delete_contacts',
805 'classpath' => 'message/externallib.php',
d6731600 806 'description' => 'Remove contacts from the contact list',
f23e9b6b 807 'type' => 'write',
c6e97f54 808 'ajax' => true,
ee7295ee 809 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
12d8c7b2 810 'ajax' => true,
d6731600 811 ),
dec0cd99
MN
812 'core_message_delete_conversation' => array(
813 'classname' => 'core_message_external',
814 'methodname' => 'delete_conversation',
815 'classpath' => 'message/externallib.php',
816 'description' => 'Deletes a conversation.',
817 'type' => 'write',
818 'capabilities' => 'moodle/site:deleteownmessage',
819 'ajax' => true,
53522c6e 820 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
dec0cd99 821 ),
f23e9b6b
CB
822 'core_message_delete_message' => array(
823 'classname' => 'core_message_external',
824 'methodname' => 'delete_message',
825 'classpath' => 'message/externallib.php',
826 'description' => 'Deletes a message.',
827 'type' => 'write',
ee7295ee 828 'capabilities' => 'moodle/site:deleteownmessage',
3090f52f 829 'ajax' => true,
ee7295ee 830 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
d6731600 831 ),
f23e9b6b
CB
832 'core_message_get_blocked_users' => array(
833 'classname' => 'core_message_external',
834 'methodname' => 'get_blocked_users',
835 'classpath' => 'message/externallib.php',
836 'description' => 'Retrieve a list of users blocked',
837 'type' => 'read',
ee7295ee 838 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
d6731600 839 ),
cd03b8d7
MN
840 'core_message_data_for_messagearea_search_messages' => array(
841 'classname' => 'core_message_external',
842 'methodname' => 'data_for_messagearea_search_messages',
843 'classpath' => 'message/externallib.php',
844 'description' => 'Retrieve the template data for searching for messages',
845 'type' => 'read',
846 'ajax' => true,
53522c6e 847 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
cd03b8d7 848 ),
48e8bdba 849 'core_message_data_for_messagearea_search_users' => array(
cd03b8d7 850 'classname' => 'core_message_external',
48e8bdba 851 'methodname' => 'data_for_messagearea_search_users',
cd03b8d7
MN
852 'classpath' => 'message/externallib.php',
853 'description' => 'Retrieve the template data for searching for people',
854 'type' => 'read',
855 'ajax' => true,
856 ),
48e8bdba 857 'core_message_data_for_messagearea_search_users_in_course' => array(
cd03b8d7 858 'classname' => 'core_message_external',
48e8bdba 859 'methodname' => 'data_for_messagearea_search_users_in_course',
cd03b8d7
MN
860 'classpath' => 'message/externallib.php',
861 'description' => 'Retrieve the template data for searching for people in a course',
862 'type' => 'read',
863 'ajax' => true,
864 ),
9aa012b5
MN
865 'core_message_data_for_messagearea_conversations' => array(
866 'classname' => 'core_message_external',
867 'methodname' => 'data_for_messagearea_conversations',
868 'classpath' => 'message/externallib.php',
869 'description' => 'Retrieve the template data for the conversation list',
870 'type' => 'read',
871 'ajax' => true,
21d9f020 872 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9aa012b5
MN
873 ),
874 'core_message_data_for_messagearea_contacts' => array(
875 'classname' => 'core_message_external',
876 'methodname' => 'data_for_messagearea_contacts',
877 'classpath' => 'message/externallib.php',
878 'description' => 'Retrieve the template data for the contact list',
879 'type' => 'read',
880 'ajax' => true,
21d9f020 881 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9aa012b5 882 ),
3cd13828
MN
883 'core_message_data_for_messagearea_messages' => array(
884 'classname' => 'core_message_external',
885 'methodname' => 'data_for_messagearea_messages',
886 'classpath' => 'message/externallib.php',
887 'description' => 'Retrieve the template data for the messages',
888 'type' => 'read',
889 'ajax' => true,
21d9f020 890 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
3cd13828 891 ),
c060cd49
MN
892 'core_message_data_for_messagearea_get_most_recent_message' => array(
893 'classname' => 'core_message_external',
894 'methodname' => 'data_for_messagearea_get_most_recent_message',
895 'classpath' => 'message/externallib.php',
896 'description' => 'Retrieve the template data for the most recent message',
897 'type' => 'read',
898 'ajax' => true,
899 ),
c6e97f54
MN
900 'core_message_data_for_messagearea_get_profile' => array(
901 'classname' => 'core_message_external',
902 'methodname' => 'data_for_messagearea_get_profile',
903 'classpath' => 'message/externallib.php',
904 'description' => 'Retrieve the template data for the users\'s profile',
905 'type' => 'read',
906 'ajax' => true,
907 ),
d6731600 908 'core_message_get_contacts' => array(
f23e9b6b
CB
909 'classname' => 'core_message_external',
910 'methodname' => 'get_contacts',
911 'classpath' => 'message/externallib.php',
d6731600 912 'description' => 'Retrieve the contact list',
f23e9b6b 913 'type' => 'read',
ee7295ee 914 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
d6731600 915 ),
aff9da17 916 'core_message_get_messages' => array(
f23e9b6b
CB
917 'classname' => 'core_message_external',
918 'methodname' => 'get_messages',
919 'classpath' => 'message/externallib.php',
920 'description' => 'Retrieve a list of messages sent and received by a user (conversations, notifications or both)',
921 'type' => 'read',
ee7295ee 922 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
3274d5ca
RW
923 'ajax' => true,
924 ),
8c55bd6c
RW
925 'core_message_get_unread_conversations_count' => array(
926 'classname' => 'core_message_external',
927 'methodname' => 'get_unread_conversations_count',
928 'classpath' => 'message/externallib.php',
929 'description' => 'Retrieve the count of unread conversations for a given user',
930 'type' => 'read',
931 'ajax' => true,
53522c6e 932 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
8c55bd6c 933 ),
3274d5ca
RW
934 'core_message_mark_all_notifications_as_read' => array(
935 'classname' => 'core_message_external',
936 'methodname' => 'mark_all_notifications_as_read',
937 'classpath' => 'message/externallib.php',
8c55bd6c
RW
938 'description' => 'Mark all notifications as read for a given user',
939 'type' => 'write',
940 'ajax' => true,
53522c6e 941 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
8c55bd6c
RW
942 ),
943 'core_message_mark_all_messages_as_read' => array(
944 'classname' => 'core_message_external',
945 'methodname' => 'mark_all_messages_as_read',
946 'classpath' => 'message/externallib.php',
947 'description' => 'Mark all messages as read for a given user',
3274d5ca
RW
948 'type' => 'write',
949 'ajax' => true,
53522c6e 950 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
60ab2e1b 951 ),
a84f89ca 952 'core_message_mark_message_read' => array(
f23e9b6b
CB
953 'classname' => 'core_message_external',
954 'methodname' => 'mark_message_read',
955 'classpath' => 'message/externallib.php',
956 'description' => 'Mark a single message as read, trigger message_viewed event.',
957 'type' => 'write',
ee7295ee 958 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
0b19d048 959 'ajax' => true,
a84f89ca 960 ),
a0eabdd3
RW
961 'core_message_message_processor_config_form' => array(
962 'classname' => 'core_message_external',
963 'methodname' => 'message_processor_config_form',
964 'classpath' => 'message/externallib.php',
965 'description' => 'Process the message processor config form',
966 'type' => 'write',
967 'ajax' => true,
53522c6e 968 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
a0eabdd3 969 ),
8c125526
RW
970 'core_message_get_message_processor' => array(
971 'classname' => 'core_message_external',
972 'methodname' => 'get_message_processor',
973 'classpath' => 'message/externallib.php',
974 'description' => 'Get a message processor',
975 'type' => 'read',
976 'ajax' => true,
977 ),
f23e9b6b
CB
978 'core_message_search_contacts' => array(
979 'classname' => 'core_message_external',
980 'methodname' => 'search_contacts',
981 'classpath' => 'message/externallib.php',
982 'description' => 'Search for contacts',
983 'type' => 'read',
ee7295ee 984 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
419b1128 985 ),
f23e9b6b
CB
986 'core_message_send_instant_messages' => array(
987 'classname' => 'core_message_external',
988 'methodname' => 'send_instant_messages',
989 'classpath' => 'message/externallib.php',
990 'description' => 'Send instant messages',
991 'type' => 'write',
ee7295ee 992 'capabilities' => 'moodle/site:sendmessage',
c060cd49 993 'ajax' => true,
ee7295ee 994 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
f23e9b6b
CB
995 ),
996 'core_message_unblock_contacts' => array(
997 'classname' => 'core_message_external',
998 'methodname' => 'unblock_contacts',
999 'classpath' => 'message/externallib.php',
1000 'description' => 'Unblock contacts',
1001 'type' => 'write',
c6e97f54 1002 'ajax' => true,
ee7295ee 1003 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 1004 ),
e86f0cb4
JL
1005 'core_message_get_user_notification_preferences' => array(
1006 'classname' => 'core_message_external',
1007 'methodname' => 'get_user_notification_preferences',
1008 'classpath' => 'message/externallib.php',
1009 'description' => 'Get the notification preferences for a given user.',
1010 'type' => 'read',
1011 'capabilities' => 'moodle/user:editownmessageprofile',
1012 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1013 ),
2521afd2
JL
1014 'core_message_get_user_message_preferences' => array(
1015 'classname' => 'core_message_external',
1016 'methodname' => 'get_user_message_preferences',
1017 'classpath' => 'message/externallib.php',
1018 'description' => 'Get the message preferences for a given user.',
1019 'type' => 'read',
1020 'capabilities' => 'moodle/user:editownmessageprofile',
1021 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1022 ),
5d1017e1 1023 'core_notes_create_notes' => array(
f23e9b6b
CB
1024 'classname' => 'core_notes_external',
1025 'methodname' => 'create_notes',
1026 'classpath' => 'notes/externallib.php',
8d46dabb 1027 'description' => 'Create notes',
f23e9b6b 1028 'type' => 'write',
ee7295ee
JL
1029 'capabilities' => 'moodle/notes:manage',
1030 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
8d46dabb 1031 ),
34348b2b 1032 'core_notes_delete_notes' => array(
f23e9b6b
CB
1033 'classname' => 'core_notes_external',
1034 'methodname' => 'delete_notes',
1035 'classpath' => 'notes/externallib.php',
34348b2b 1036 'description' => 'Delete notes',
f23e9b6b 1037 'type' => 'write',
ee7295ee
JL
1038 'capabilities' => 'moodle/notes:manage',
1039 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
f23e9b6b
CB
1040 ),
1041 'core_notes_get_course_notes' => array(
1042 'classname' => 'core_notes_external',
1043 'methodname' => 'get_course_notes',
1044 'classpath' => 'notes/externallib.php',
1045 'description' => 'Returns all notes in specified course (or site), for the specified user.',
1046 'type' => 'read',
ee7295ee
JL
1047 'capabilities' => 'moodle/notes:view',
1048 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
34348b2b 1049 ),
34348b2b 1050 'core_notes_get_notes' => array(
f23e9b6b
CB
1051 'classname' => 'core_notes_external',
1052 'methodname' => 'get_notes',
1053 'classpath' => 'notes/externallib.php',
34348b2b 1054 'description' => 'Get notes',
f23e9b6b
CB
1055 'type' => 'read',
1056 'capabilities' => 'moodle/notes:view'
34348b2b 1057 ),
34348b2b 1058 'core_notes_update_notes' => array(
f23e9b6b
CB
1059 'classname' => 'core_notes_external',
1060 'methodname' => 'update_notes',
1061 'classpath' => 'notes/externallib.php',
34348b2b 1062 'description' => 'Update notes',
f23e9b6b
CB
1063 'type' => 'write',
1064 'capabilities' => 'moodle/notes:manage'
34348b2b 1065 ),
a80b5518 1066 'core_notes_view_notes' => array(
f23e9b6b
CB
1067 'classname' => 'core_notes_external',
1068 'methodname' => 'view_notes',
1069 'classpath' => 'notes/externallib.php',
1070 'description' => 'Simulates the web interface view of notes/index.php: trigger events.',
1071 'type' => 'write',
ee7295ee
JL
1072 'capabilities' => 'moodle/notes:view',
1073 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9028d9b5 1074 ),
f23e9b6b
CB
1075 'core_output_load_template' => array(
1076 'classname' => 'core\output\external',
1077 'methodname' => 'load_template',
1078 'description' => 'Load a template for a renderable',
1079 'type' => 'read',
5041600d
RT
1080 'loginrequired' => false,
1081 'ajax' => true,
0ff4ebb4 1082 ),
e330b1c2 1083 'core_output_load_fontawesome_icon_map' => array(
a26ce248 1084 'classname' => 'core\output\external',
e330b1c2 1085 'methodname' => 'load_fontawesome_icon_map',
a26ce248
DW
1086 'description' => 'Load the mapping of names to icons',
1087 'type' => 'read',
1088 'loginrequired' => false,
1089 'ajax' => true,
1090 ),
f23e9b6b
CB
1091 // Question related functions.
1092 'core_question_update_flag' => array(
1093 'classname' => 'core_question_external',
1094 'methodname' => 'update_flag',
1095 'description' => 'Update the flag state of a question attempt.',
1096 'type' => 'write',
1097 'capabilities' => 'moodle/question:flag',
ee7295ee 1098 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
3f0ea6d8 1099 ),
f23e9b6b
CB
1100 'core_rating_get_item_ratings' => array(
1101 'classname' => 'core_rating_external',
1102 'methodname' => 'get_item_ratings',
1103 'description' => 'Retrieve all the ratings for an item.',
1104 'type' => 'read',
ee7295ee
JL
1105 'capabilities' => 'moodle/rating:view',
1106 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
5d1017e1 1107 ),
afb7799a
JL
1108 'core_rating_add_rating' => array(
1109 'classname' => 'core_rating_external',
1110 'methodname' => 'add_rating',
1111 'description' => 'Rates an item.',
1112 'type' => 'write',
1113 'capabilities' => 'moodle/rating:rate',
1114 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1115 ),
f23e9b6b
CB
1116 'core_role_assign_roles' => array(
1117 'classname' => 'core_role_external',
1118 'methodname' => 'assign_roles',
1119 'classpath' => 'enrol/externallib.php',
1120 'description' => 'Manual role assignments.',
1121 'type' => 'write',
1122 'capabilities' => 'moodle/role:assign'
0bf486a6 1123 ),
f23e9b6b
CB
1124 'core_role_unassign_roles' => array(
1125 'classname' => 'core_role_external',
1126 'methodname' => 'unassign_roles',
1127 'classpath' => 'enrol/externallib.php',
1128 'description' => 'Manual role unassignments.',
1129 'type' => 'write',
1130 'capabilities' => 'moodle/role:assign'
11e76602 1131 ),
f23e9b6b
CB
1132 'core_tag_get_tagindex' => array(
1133 'classname' => 'core_tag_external',
1134 'methodname' => 'get_tagindex',
1135 'description' => 'Gets tag index page for one tag and one tag area',
1136 'type' => 'read',
5041600d 1137 'ajax' => true,
11e76602 1138 ),
f23e9b6b
CB
1139 'core_tag_get_tags' => array(
1140 'classname' => 'core_tag_external',
1141 'methodname' => 'get_tags',
1142 'description' => 'Gets tags by their ids',
1143 'type' => 'read',
5041600d 1144 'ajax' => true,
11e76602 1145 ),
f23e9b6b
CB
1146 'core_tag_update_tags' => array(
1147 'classname' => 'core_tag_external',
1148 'methodname' => 'update_tags',
1149 'description' => 'Updates tags',
1150 'type' => 'write',
5041600d 1151 'ajax' => true,
cc73ea07 1152 ),
cdc5f978 1153 'core_update_inplace_editable' => array(
f23e9b6b
CB
1154 'classname' => 'core_external',
1155 'methodname' => 'update_inplace_editable',
1156 'classpath' => 'lib/external/externallib.php',
cdc5f978 1157 'description' => 'Generic service to update title',
f23e9b6b 1158 'type' => 'write',
5041600d
RT
1159 'loginrequired' => true,
1160 'ajax' => true,
c66dc3df 1161 ),
f23e9b6b
CB
1162 'core_user_add_user_device' => array(
1163 'classname' => 'core_user_external',
1164 'methodname' => 'add_user_device',
1165 'classpath' => 'user/externallib.php',
1166 'description' => 'Store mobile user devices information for PUSH Notifications.',
1167 'type' => 'write',
ee7295ee 1168 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
9bdcf579 1169 ),
f23e9b6b
CB
1170 'core_user_add_user_private_files' => array(
1171 'classname' => 'core_user_external',
1172 'methodname' => 'add_user_private_files',
1173 'classpath' => 'user/externallib.php',
1174 'description' => 'Copy files from a draft area to users private files area.',
1175 'type' => 'write',
ee7295ee
JL
1176 'capabilities' => 'moodle/user:manageownfiles',
1177 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
25c49a85 1178 ),
f23e9b6b
CB
1179 'core_user_create_users' => array(
1180 'classname' => 'core_user_external',
1181 'methodname' => 'create_users',
1182 'classpath' => 'user/externallib.php',
1183 'description' => 'Create users.',
1184 'type' => 'write',
1185 'capabilities' => 'moodle/user:create'
23b398fc 1186 ),
f23e9b6b
CB
1187 'core_user_delete_users' => array(
1188 'classname' => 'core_user_external',
1189 'methodname' => 'delete_users',
1190 'classpath' => 'user/externallib.php',
1191 'description' => 'Delete users.',
1192 'type' => 'write',
1193 'capabilities' => 'moodle/user:delete'
6c785afa 1194 ),
f23e9b6b
CB
1195 'core_user_get_course_user_profiles' => array(
1196 'classname' => 'core_user_external',
1197 'methodname' => 'get_course_user_profiles',
1198 'classpath' => 'user/externallib.php',
1199 'description' => 'Get course user profiles (each of the profils matching a course id and a user id),.',
1200 'type' => 'read',
1201 'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, '
ee7295ee
JL
1202 . 'moodle/site:accessallgroups',
1203 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
6c785afa 1204 ),
f23e9b6b
CB
1205 'core_user_get_users' => array(
1206 'classname' => 'core_user_external',
1207 'methodname' => 'get_users',
1208 'classpath' => 'user/externallib.php',
1209 'description' => 'search for users matching the parameters',
1210 'type' => 'read',
1211 'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update'
db5b6971 1212 ),
f23e9b6b
CB
1213 'core_user_get_users_by_field' => array(
1214 'classname' => 'core_user_external',
1215 'methodname' => 'get_users_by_field',
1216 'classpath' => 'user/externallib.php',
1217 'description' => 'Retrieve users\' information for a specified unique field - If you want to do a user search, use '
1218 . 'core_user_get_users()',
1219 'type' => 'read',
ee7295ee 1220 'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
5041600d 1221 'ajax' => true,
ee7295ee 1222 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
8e355853 1223 ),
f23e9b6b
CB
1224 'core_user_remove_user_device' => array(
1225 'classname' => 'core_user_external',
1226 'methodname' => 'remove_user_device',
1227 'classpath' => 'user/externallib.php',
1228 'description' => 'Remove a user device from the Moodle database.',
1229 'type' => 'write',
ee7295ee 1230 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
ef4c23cc 1231 ),
c598f278 1232 'core_user_update_users' => array(
a0eabdd3 1233 'classname' => 'core_user_external',
c598f278 1234 'methodname' => 'update_users',
a0eabdd3 1235 'classpath' => 'user/externallib.php',
c598f278 1236 'description' => 'Update users.',
a0eabdd3
RW
1237 'type' => 'write',
1238 'capabilities' => 'moodle/user:update',
1239 'ajax' => true,
1240 ),
c598f278 1241 'core_user_update_user_preferences' => array(
f23e9b6b 1242 'classname' => 'core_user_external',
c598f278 1243 'methodname' => 'update_user_preferences',
f23e9b6b 1244 'classpath' => 'user/externallib.php',
c598f278 1245 'description' => 'Update a user\'s preferences',
f23e9b6b 1246 'type' => 'write',
c598f278 1247 'capabilities' => 'moodle/user:editownmessageprofile, moodle/user:editmessageprofile',
a0eabdd3 1248 'ajax' => true,
6d2f938c 1249 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
c026a28d 1250 ),
f23e9b6b
CB
1251 'core_user_view_user_list' => array(
1252 'classname' => 'core_user_external',
1253 'methodname' => 'view_user_list',
1254 'classpath' => 'user/externallib.php',
1255 'description' => 'Simulates the web-interface view of user/index.php (triggering events),.',
1256 'type' => 'write',
1257 'capabilities' => 'moodle/course:viewparticipants',
ee7295ee 1258 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
7361b968 1259 ),
f23e9b6b
CB
1260 'core_user_view_user_profile' => array(
1261 'classname' => 'core_user_external',
1262 'methodname' => 'view_user_profile',
1263 'classpath' => 'user/externallib.php',
1264 'description' => 'Simulates the web-interface view of user/view.php and user/profile.php (triggering events),.',
1265 'type' => 'write',
1266 'capabilities' => 'moodle/user:viewdetails',
ee7295ee 1267 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
f4fb827e 1268 ),
45fec983
JL
1269 'core_user_get_user_preferences' => array(
1270 'classname' => 'core_user_external',
1271 'methodname' => 'get_user_preferences',
1272 'classpath' => 'user/externallib.php',
1273 'description' => 'Return user preferences.',
1274 'type' => 'read',
1275 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1276 ),
d44e2e42
JL
1277 'core_user_update_picture' => array(
1278 'classname' => 'core_user_external',
1279 'methodname' => 'update_picture',
1280 'classpath' => 'user/externallib.php',
1281 'description' => 'Update or delete the user picture in the site',
1282 'type' => 'write',
1283 'capabilities' => 'moodle/user:editownprofile, moodle/user:editprofile',
1284 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1285 ),
649777fb
JL
1286 'core_user_set_user_preferences' => array(
1287 'classname' => 'core_user_external',
1288 'methodname' => 'set_user_preferences',
1289 'classpath' => 'user/externallib.php',
1290 'description' => 'Set user preferences.',
1291 'type' => 'write',
1292 'capabilities' => 'moodle/site:config',
1293 ),
3e8145a3
JL
1294 'core_user_agree_site_policy' => array(
1295 'classname' => 'core_user_external',
1296 'methodname' => 'agree_site_policy',
1297 'classpath' => 'user/externallib.php',
1298 'description' => 'Agree the site policy for the current user.',
1299 'type' => 'write',
1300 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1301 ),
f74ac6e7
JL
1302 'core_user_get_private_files_info' => array(
1303 'classname' => 'core_user_external',
1304 'methodname' => 'get_private_files_info',
1305 'classpath' => 'user/externallib.php',
1306 'description' => 'Returns general information about files in the user private files area.',
1307 'type' => 'read',
1308 'capabilities' => 'moodle/user:manageownfiles',
1309 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1310 ),
649777fb 1311
81de839f
FM
1312 // Competencies functions.
1313 'core_competency_create_competency_framework' => array(
1314 'classname' => 'core_competency\external',
1315 'methodname' => 'create_competency_framework',
1316 'classpath' => '',
1317 'description' => 'Creates new competency frameworks.',
1318 'type' => 'write',
1319 'capabilities' => 'moodle/competency:competencymanage',
1320 'ajax' => true,
1321 ),
1322 'core_competency_read_competency_framework' => array(
1323 'classname' => 'core_competency\external',
1324 'methodname' => 'read_competency_framework',
1325 'classpath' => '',
1326 'description' => 'Load a summary of a competency framework.',
1327 'type' => 'read',
1328 'capabilities' => 'moodle/competency:competencyview',
1329 'ajax' => true,
1330 ),
1331 'core_competency_duplicate_competency_framework' => array(
1332 'classname' => 'core_competency\external',
1333 'methodname' => 'duplicate_competency_framework',
1334 'classpath' => '',
1335 'description' => 'Duplicate a competency framework.',
1336 'type' => 'write',
1337 'capabilities' => 'moodle/competency:competencymanage',
1338 'ajax' => true,
1339 ),
1340 'core_competency_delete_competency_framework' => array(
1341 'classname' => 'core_competency\external',
1342 'methodname' => 'delete_competency_framework',
1343 'classpath' => '',
1344 'description' => 'Delete a competency framework.',
1345 'type' => 'write',
1346 'capabilities' => 'moodle/competency:competencymanage',
1347 'ajax' => true,
1348 ),
1349 'core_competency_update_competency_framework' => array(
1350 'classname' => 'core_competency\external',
1351 'methodname' => 'update_competency_framework',
1352 'classpath' => '',
1353 'description' => 'Update a competency framework.',
1354 'type' => 'write',
1355 'capabilities' => 'moodle/competency:competencymanage',
1356 'ajax' => true,
1357 ),
1358 'core_competency_list_competency_frameworks' => array(
1359 'classname' => 'core_competency\external',
1360 'methodname' => 'list_competency_frameworks',
1361 'classpath' => '',
1362 'description' => 'Load a list of a competency frameworks.',
1363 'type' => 'read',
1364 'capabilities' => 'moodle/competency:competencyview',
1365 'ajax' => true,
1366 ),
1367 'core_competency_count_competency_frameworks' => array(
1368 'classname' => 'core_competency\external',
1369 'methodname' => 'count_competency_frameworks',
1370 'classpath' => '',
1371 'description' => 'Count a list of a competency frameworks.',
1372 'type' => 'read',
1373 'capabilities' => 'moodle/competency:competencyview',
1374 'ajax' => true,
1375 ),
1376 'core_competency_competency_framework_viewed' => array(
1377 'classname' => 'core_competency\external',
1378 'methodname' => 'competency_framework_viewed',
1379 'classpath' => '',
1380 'description' => 'Log event competency framework viewed',
1381 'type' => 'read',
1382 'capabilities' => 'moodle/competency:competencyview',
1383 'ajax' => true,
1384 ),
1385 'core_competency_create_competency' => array(
1386 'classname' => 'core_competency\external',
1387 'methodname' => 'create_competency',
1388 'classpath' => '',
1389 'description' => 'Creates new competencies.',
1390 'type' => 'write',
1391 'capabilities' => 'moodle/competency:competencymanage',
1392 'ajax' => true,
1393 ),
1394 'core_competency_read_competency' => array(
1395 'classname' => 'core_competency\external',
1396 'methodname' => 'read_competency',
1397 'classpath' => '',
1398 'description' => 'Load a summary of a competency.',
1399 'type' => 'read',
1400 'capabilities' => 'moodle/competency:competencyview',
1401 'ajax' => true,
1402 ),
1403 'core_competency_competency_viewed' => array(
1404 'classname' => 'core_competency\external',
1405 'methodname' => 'competency_viewed',
1406 'classpath' => '',
1407 'description' => 'Log event competency viewed',
1408 'type' => 'read',
1409 'capabilities' => 'moodle/competency:competencyview',
1410 'ajax' => true,
3123c2cf 1411 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1412 ),
1413 'core_competency_delete_competency' => array(
1414 'classname' => 'core_competency\external',
1415 'methodname' => 'delete_competency',
1416 'classpath' => '',
1417 'description' => 'Delete a competency.',
1418 'type' => 'write',
1419 'capabilities' => 'moodle/competency:competencymanage',
1420 'ajax' => true,
1421 ),
1422 'core_competency_update_competency' => array(
1423 'classname' => 'core_competency\external',
1424 'methodname' => 'update_competency',
1425 'classpath' => '',
1426 'description' => 'Update a competency.',
1427 'type' => 'write',
1428 'capabilities' => 'moodle/competency:competencymanage',
1429 'ajax' => true,
1430 ),
1431 'core_competency_list_competencies' => array(
1432 'classname' => 'core_competency\external',
1433 'methodname' => 'list_competencies',
1434 'classpath' => '',
1435 'description' => 'Load a list of a competencies.',
1436 'type' => 'read',
1437 'capabilities' => 'moodle/competency:competencyview',
1438 'ajax' => true,
1439 ),
1440 'core_competency_list_competencies_in_template' => array(
1441 'classname' => 'core_competency\external',
1442 'methodname' => 'list_competencies_in_template',
1443 'classpath' => '',
1444 'description' => 'Load a list of a competencies for a given template.',
1445 'type' => 'read',
1446 'capabilities' => 'moodle/competency:competencyview',
1447 'ajax' => true,
1448 ),
1449 'core_competency_count_competencies' => array(
1450 'classname' => 'core_competency\external',
1451 'methodname' => 'count_competencies',
1452 'classpath' => '',
1453 'description' => 'Count a list of a competencies.',
1454 'type' => 'read',
1455 'capabilities' => 'moodle/competency:competencyview',
1456 'ajax' => true,
1457 ),
1458 'core_competency_count_competencies_in_template' => array(
1459 'classname' => 'core_competency\external',
1460 'methodname' => 'count_competencies_in_template',
1461 'classpath' => '',
1462 'description' => 'Count a list of a competencies for a given template.',
1463 'type' => 'read',
1464 'capabilities' => 'moodle/competency:competencyview',
1465 'ajax' => true,
1466 ),
1467 'core_competency_search_competencies' => array(
1468 'classname' => 'core_competency\external',
1469 'methodname' => 'search_competencies',
1470 'classpath' => '',
1471 'description' => 'Search a list of a competencies.',
1472 'type' => 'read',
1473 'capabilities' => 'moodle/competency:competencyview',
1474 'ajax' => true,
1475 ),
1476 'core_competency_set_parent_competency' => array(
1477 'classname' => 'core_competency\external',
1478 'methodname' => 'set_parent_competency',
1479 'classpath' => '',
1480 'description' => 'Set a new parent for a competency.',
1481 'type' => 'write',
1482 'capabilities' => 'moodle/competency:competencymanage',
1483 'ajax' => true,
1484 ),
1485 'core_competency_move_up_competency' => array(
1486 'classname' => 'core_competency\external',
1487 'methodname' => 'move_up_competency',
1488 'classpath' => '',
1489 'description' => 'Re-order a competency.',
1490 'type' => 'write',
1491 'capabilities' => 'moodle/competency:competencymanage',
1492 'ajax' => true,
1493 ),
1494 'core_competency_move_down_competency' => array(
1495 'classname' => 'core_competency\external',
1496 'methodname' => 'move_down_competency',
1497 'classpath' => '',
1498 'description' => 'Re-order a competency.',
1499 'type' => 'write',
1500 'capabilities' => 'moodle/competency:competencymanage',
1501 'ajax' => true,
1502 ),
1503 'core_competency_list_course_competencies' => array(
1504 'classname' => 'core_competency\external',
1505 'methodname' => 'list_course_competencies',
1506 'classpath' => '',
1507 'description' => 'List the competencies in a course',
1508 'type' => 'read',
1509 'capabilities' => 'moodle/competency:coursecompetencyview',
1510 'ajax' => true,
3123c2cf 1511 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1512 ),
1513 'core_competency_count_competencies_in_course' => array(
1514 'classname' => 'core_competency\external',
1515 'methodname' => 'count_competencies_in_course',
1516 'classpath' => '',
1517 'description' => 'List the competencies in a course',
1518 'type' => 'read',
1519 'capabilities' => 'moodle/competency:coursecompetencyview',
1520 'ajax' => true,
1521 ),
1522 'core_competency_count_courses_using_competency' => array(
1523 'classname' => 'core_competency\external',
1524 'methodname' => 'count_courses_using_competency',
1525 'classpath' => '',
1526 'description' => 'List the courses using a competency',
1527 'type' => 'read',
1528 'capabilities' => 'moodle/competency:coursecompetencyview',
1529 'ajax' => true,
1530 ),
1531 'core_competency_add_competency_to_course' => array(
1532 'classname' => 'core_competency\external',
1533 'methodname' => 'add_competency_to_course',
1534 'classpath' => '',
1535 'description' => 'Add the competency to a course',
1536 'type' => 'write',
1537 'capabilities' => 'moodle/competency:coursecompetencymanage',
1538 'ajax' => true,
1539 ),
1540 'core_competency_add_competency_to_template' => array(
1541 'classname' => 'core_competency\external',
1542 'methodname' => 'add_competency_to_template',
1543 'classpath' => '',
1544 'description' => 'Add the competency to a template',
1545 'type' => 'write',
1546 'capabilities' => 'moodle/competency:templatemanage',
1547 'ajax' => true,
1548 ),
1549 'core_competency_remove_competency_from_course' => array(
1550 'classname' => 'core_competency\external',
1551 'methodname' => 'remove_competency_from_course',
1552 'classpath' => '',
1553 'description' => 'Remove a competency from a course',
1554 'type' => 'write',
1555 'capabilities' => 'moodle/competency:coursecompetencymanage',
1556 'ajax' => true,
1557 ),
1558 'core_competency_set_course_competency_ruleoutcome' => array(
1559 'classname' => 'core_competency\external',
1560 'methodname' => 'set_course_competency_ruleoutcome',
1561 'classpath' => '',
1562 'description' => 'Modify the ruleoutcome value for course competency',
1563 'type' => 'write',
1564 'capabilities' => 'moodle/competency:coursecompetencymanage',
1565 'ajax' => true,
1566 ),
1567 'core_competency_remove_competency_from_template' => array(
1568 'classname' => 'core_competency\external',
1569 'methodname' => 'remove_competency_from_template',
1570 'classpath' => '',
1571 'description' => 'Remove a competency from a template',
1572 'type' => 'write',
1573 'capabilities' => 'moodle/competency:templatemanage',
1574 'ajax' => true,
1575 ),
1576 'core_competency_reorder_course_competency' => array(
1577 'classname' => 'core_competency\external',
1578 'methodname' => 'reorder_course_competency',
1579 'classpath' => '',
1580 'description' => 'Move a course competency to a new relative sort order.',
1581 'type' => 'write',
1582 'capabilities' => 'moodle/competency:coursecompetencymanage',
1583 'ajax' => true,
1584 ),
1585 'core_competency_reorder_template_competency' => array(
1586 'classname' => 'core_competency\external',
1587 'methodname' => 'reorder_template_competency',
1588 'classpath' => '',
1589 'description' => 'Move a template competency to a new relative sort order.',
1590 'type' => 'write',
1591 'capabilities' => 'moodle/competency:templatemanage',
1592 'ajax' => true,
1593 ),
1594 'core_competency_create_template' => array(
1595 'classname' => 'core_competency\external',
1596 'methodname' => 'create_template',
1597 'classpath' => '',
1598 'description' => 'Creates new learning plan templates.',
1599 'type' => 'write',
1600 'capabilities' => 'moodle/competency:templatemanage',
1601 'ajax' => true,
1602 ),
1603 'core_competency_duplicate_template' => array(
1604 'classname' => 'core_competency\external',
1605 'methodname' => 'duplicate_template',
1606 'classpath' => '',
1607 'description' => 'Duplicate learning plan template.',
1608 'type' => 'write',
1609 'capabilities' => 'moodle/competency:templatemanage',
1610 'ajax' => true,
1611 ),
1612 'core_competency_read_template' => array(
1613 'classname' => 'core_competency\external',
1614 'methodname' => 'read_template',
1615 'classpath' => '',
1616 'description' => 'Load a summary of a learning plan template.',
1617 'type' => 'read',
1618 'capabilities' => 'moodle/competency:templateview',
1619 'ajax' => true,
1620 ),
1621 'core_competency_delete_template' => array(
1622 'classname' => 'core_competency\external',
1623 'methodname' => 'delete_template',
1624 'classpath' => '',
1625 'description' => 'Delete a learning plan template.',
1626 'type' => 'write',
1627 'capabilities' => 'moodle/competency:templatemanage',
1628 'ajax' => true,
1629 ),
1630 'core_competency_update_template' => array(
1631 'classname' => 'core_competency\external',
1632 'methodname' => 'update_template',
1633 'classpath' => '',
1634 'description' => 'Update a learning plan template.',
1635 'type' => 'write',
1636 'capabilities' => 'moodle/competency:templatemanage',
1637 'ajax' => true,
1638 ),
1639 'core_competency_list_templates' => array(
1640 'classname' => 'core_competency\external',
1641 'methodname' => 'list_templates',
1642 'classpath' => '',
1643 'description' => 'Load a list of a learning plan templates.',
1644 'type' => 'read',
1645 'capabilities' => 'moodle/competency:templateview',
1646 'ajax' => true,
1647 ),
1648 'core_competency_list_templates_using_competency' => array(
1649 'classname' => 'core_competency\external',
1650 'methodname' => 'list_templates_using_competency',
1651 'classpath' => '',
1652 'description' => 'Load a list of a learning plan templates for a given competency.',
1653 'type' => 'read',
1654 'capabilities' => 'moodle/competency:templateview',
1655 'ajax' => true,
1656 ),
1657 'core_competency_count_templates' => array(
1658 'classname' => 'core_competency\external',
1659 'methodname' => 'count_templates',
1660 'classpath' => '',
1661 'description' => 'Count a list of a learning plan templates.',
1662 'type' => 'read',
1663 'capabilities' => 'moodle/competency:templateview',
1664 'ajax' => true,
1665 ),
1666 'core_competency_count_templates_using_competency' => array(
1667 'classname' => 'core_competency\external',
1668 'methodname' => 'count_templates_using_competency',
1669 'classpath' => '',
1670 'description' => 'Count a list of a learning plan templates for a given competency.',
1671 'type' => 'read',
1672 'capabilities' => 'moodle/competency:templateview',
1673 'ajax' => true,
1674 ),
1675 'core_competency_create_plan' => array(
1676 'classname' => 'core_competency\external',
1677 'methodname' => 'create_plan',
1678 'classpath' => '',
1679 'description' => 'Creates a learning plan.',
1680 'type' => 'write',
1681 'capabilities' => 'moodle/competency:planmanage',
1682 'ajax' => true,
1683 ),
1684 'core_competency_update_plan' => array(
1685 'classname' => 'core_competency\external',
1686 'methodname' => 'update_plan',
1687 'classpath' => '',
1688 'description' => 'Updates a learning plan.',
1689 'type' => 'write',
1690 'capabilities' => 'moodle/competency:planmanage',
1691 'ajax' => true,
1692 ),
1693 'core_competency_complete_plan' => array(
1694 'classname' => 'core_competency\external',
1695 'methodname' => 'complete_plan',
1696 'classpath' => '',
1697 'description' => 'Complete learning plan.',
1698 'type' => 'write',
1699 'capabilities' => 'moodle/competency:planmanage',
1700 'ajax' => true,
1701 ),
1702 'core_competency_reopen_plan' => array(
1703 'classname' => 'core_competency\external',
1704 'methodname' => 'reopen_plan',
1705 'classpath' => '',
1706 'description' => 'Reopen learning plan.',
1707 'type' => 'write',
1708 'capabilities' => 'moodle/competency:planmanage',
1709 'ajax' => true,
1710 ),
1711 'core_competency_read_plan' => array(
1712 'classname' => 'core_competency\external',
1713 'methodname' => 'read_plan',
1714 'classpath' => '',
1715 'description' => 'Load a learning plan.',
1716 'type' => 'read',
1717 'capabilities' => 'moodle/competency:planviewown',
1718 'ajax' => true,
1719 ),
1720 'core_competency_delete_plan' => array(
1721 'classname' => 'core_competency\external',
1722 'methodname' => 'delete_plan',
1723 'classpath' => '',
1724 'description' => 'Delete a learning plan.',
1725 'type' => 'write',
1726 'capabilities' => 'moodle/competency:planmanage',
1727 'ajax' => true,
1728 ),
1729 'core_competency_list_user_plans' => array(
1730 'classname' => 'core_competency\external',
1731 'methodname' => 'list_user_plans',
1732 'classpath' => '',
1733 'description' => 'List a user\'s learning plans.',
1734 'type' => 'read',
1735 'capabilities' => 'moodle/competency:planviewown',
1736 'ajax' => true,
1737 ),
1738 'core_competency_list_plan_competencies' => array(
1739 'classname' => 'core_competency\external',
1740 'methodname' => 'list_plan_competencies',
1741 'classpath' => '',
1742 'description' => 'List the competencies in a plan',
1743 'type' => 'read',
1744 'capabilities' => 'moodle/competency:planviewown',
1745 'ajax' => true,
1746 ),
1747 'core_competency_add_competency_to_plan' => array(
1748 'classname' => 'core_competency\external',
1749 'methodname' => 'add_competency_to_plan',
1750 'classpath' => '',
1751 'description' => 'Add the competency to a learning plan',
1752 'type' => 'write',
1753 'capabilities' => 'moodle/competency:planmanage',
1754 'ajax' => true,
1755 ),
1756 'core_competency_remove_competency_from_plan' => array(
1757 'classname' => 'core_competency\external',
1758 'methodname' => 'remove_competency_from_plan',
1759 'classpath' => '',
1760 'description' => 'Remove the competency from a learning plan',
1761 'type' => 'write',
1762 'capabilities' => 'moodle/competency:planmanage',
1763 'ajax' => true,
1764 ),
1765 'core_competency_reorder_plan_competency' => array(
1766 'classname' => 'core_competency\external',
1767 'methodname' => 'reorder_plan_competency',
1768 'classpath' => '',
1769 'description' => 'Move a plan competency to a new relative sort order.',
1770 'type' => 'write',
1771 'capabilities' => 'moodle/competency:planmanage',
1772 'ajax' => true,
1773 ),
1774 'core_competency_plan_request_review' => array(
1775 'classname' => 'core_competency\external',
1776 'methodname' => 'plan_request_review',
1777 'classpath' => '',
1778 'description' => 'Request for a plan to be reviewed.',
1779 'type' => 'write',
1780 'capabilities' => 'moodle/competency:planmanagedraft',
1781 'ajax' => true,
1782 ),
1783 'core_competency_plan_start_review' => array(
1784 'classname' => 'core_competency\external',
1785 'methodname' => 'plan_start_review',
1786 'classpath' => '',
1787 'description' => 'Start the review of a plan.',
1788 'type' => 'write',
1789 'capabilities' => 'moodle/competency:planmanage',
1790 'ajax' => true,
1791 ),
1792 'core_competency_plan_stop_review' => array(
1793 'classname' => 'core_competency\external',
1794 'methodname' => 'plan_stop_review',
1795 'classpath' => '',
1796 'description' => 'Stop the review of a plan.',
1797 'type' => 'write',
1798 'capabilities' => 'moodle/competency:planmanage',
1799 'ajax' => true,
1800 ),
1801 'core_competency_plan_cancel_review_request' => array(
1802 'classname' => 'core_competency\external',
1803 'methodname' => 'plan_cancel_review_request',
1804 'classpath' => '',
1805 'description' => 'Cancel the review of a plan.',
1806 'type' => 'write',
1807 'capabilities' => 'moodle/competency:planmanagedraft',
1808 'ajax' => true,
1809 ),
1810 'core_competency_approve_plan' => array(
1811 'classname' => 'core_competency\external',
1812 'methodname' => 'approve_plan',
1813 'classpath' => '',
1814 'description' => 'Approve a plan.',
1815 'type' => 'write',
1816 'capabilities' => 'moodle/competency:planmanage',
1817 'ajax' => true,
1818 ),
1819 'core_competency_unapprove_plan' => array(
1820 'classname' => 'core_competency\external',
1821 'methodname' => 'unapprove_plan',
1822 'classpath' => '',
1823 'description' => 'Unapprove a plan.',
1824 'type' => 'write',
1825 'capabilities' => 'moodle/competency:planmanage',
1826 'ajax' => true,
1827 ),
1828 'core_competency_template_has_related_data' => array(
1829 'classname' => 'core_competency\external',
1830 'methodname' => 'template_has_related_data',
1831 'classpath' => '',
1832 'description' => 'Check if a template has related data',
1833 'type' => 'read',
1834 'capabilities' => 'moodle/competency:templateview',
1835 'ajax' => true,
1836 ),
1837 'core_competency_get_scale_values' => array(
1838 'classname' => 'core_competency\external',
1839 'methodname' => 'get_scale_values',
1840 'classpath' => '',
1841 'description' => 'Fetch the values for a specific scale',
1842 'type' => 'read',
1843 'capabilities' => 'moodle/competency:competencymanage',
1844 'ajax' => true,
3123c2cf 1845 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1846 ),
1847 'core_competency_add_related_competency' => array(
1848 'classname' => 'core_competency\external',
1849 'methodname' => 'add_related_competency',
1850 'classpath' => '',
1851 'description' => 'Adds a related competency',
1852 'type' => 'write',
1853 'capabilities' => 'moodle/competency:competencymanage',
1854 'ajax' => true,
1855 ),
1856 'core_competency_remove_related_competency' => array(
1857 'classname' => 'core_competency\external',
1858 'methodname' => 'remove_related_competency',
1859 'classpath' => '',
1860 'description' => 'Remove a related competency',
1861 'type' => 'write',
1862 'capabilities' => 'moodle/competency:competencymanage',
1863 'ajax' => true,
1864 ),
1865 'core_competency_read_user_evidence' => array(
1866 'classname' => 'core_competency\external',
1867 'methodname' => 'read_user_evidence',
1868 'classpath' => '',
1869 'description' => 'Read an evidence of prior learning.',
1870 'type' => 'read',
1871 'capabilities' => 'moodle/competency:userevidenceview',
1872 'ajax' => true,
1873 ),
1874 'core_competency_delete_user_evidence' => array(
1875 'classname' => 'core_competency\external',
1876 'methodname' => 'delete_user_evidence',
1877 'classpath' => '',
1878 'description' => 'Delete an evidence of prior learning.',
1879 'type' => 'write',
1880 'capabilities' => 'moodle/competency:userevidencemanageown',
1881 'ajax' => true,
1882 ),
1883 'core_competency_create_user_evidence_competency' => array(
1884 'classname' => 'core_competency\external',
1885 'methodname' => 'create_user_evidence_competency',
1886 'classpath' => '',
1887 'description' => 'Create an evidence of prior learning relationship with a competency.',
1888 'type' => 'read',
1889 'capabilities' => 'moodle/competency:userevidencemanageown, moodle/competency:competencyview',
1890 'ajax' => true,
1891 ),
1892 'core_competency_delete_user_evidence_competency' => array(
1893 'classname' => 'core_competency\external',
1894 'methodname' => 'delete_user_evidence_competency',
1895 'classpath' => '',
1896 'description' => 'Delete an evidence of prior learning relationship with a competency.',
1897 'type' => 'write',
1898 'capabilities' => 'moodle/competency:userevidencemanageown',
1899 'ajax' => true,
1900 ),
1901 'core_competency_user_competency_cancel_review_request' => array(
1902 'classname' => 'core_competency\external',
1903 'methodname' => 'user_competency_cancel_review_request',
1904 'classpath' => '',
1905 'description' => 'Cancel a review request.',
1906 'type' => 'write',
1907 'capabilities' => 'moodle/competency:userevidencemanageown',
1908 'ajax' => true,
1909 ),
1910 'core_competency_user_competency_request_review' => array(
1911 'classname' => 'core_competency\external',
1912 'methodname' => 'user_competency_request_review',
1913 'classpath' => '',
1914 'description' => 'Request a review.',
1915 'type' => 'write',
1916 'capabilities' => 'moodle/competency:userevidencemanageown',
1917 'ajax' => true,
1918 ),
1919 'core_competency_user_competency_start_review' => array(
1920 'classname' => 'core_competency\external',
1921 'methodname' => 'user_competency_start_review',
1922 'classpath' => '',
1923 'description' => 'Start a review.',
1924 'type' => 'write',
1925 'capabilities' => 'moodle/competency:competencygrade',
1926 'ajax' => true,
1927 ),
1928 'core_competency_user_competency_stop_review' => array(
1929 'classname' => 'core_competency\external',
1930 'methodname' => 'user_competency_stop_review',
1931 'classpath' => '',
1932 'description' => 'Stop a review.',
1933 'type' => 'write',
1934 'capabilities' => 'moodle/competency:competencygrade',
1935 'ajax' => true,
1936 ),
1937 'core_competency_user_competency_viewed' => array(
1938 'classname' => 'core_competency\external',
1939 'methodname' => 'user_competency_viewed',
1940 'classpath' => '',
1941 'description' => 'Log the user competency viewed event.',
1942 'type' => 'read',
1943 'capabilities' => 'moodle/competency:usercompetencyview',
1944 'ajax' => true,
3123c2cf 1945 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1946 ),
1947 'core_competency_user_competency_viewed_in_plan' => array(
1948 'classname' => 'core_competency\external',
1949 'methodname' => 'user_competency_viewed_in_plan',
1950 'classpath' => '',
1951 'description' => 'Log the user competency viewed in plan event.',
1952 'type' => 'read',
1953 'capabilities' => 'moodle/competency:usercompetencyview',
1954 'ajax' => true,
3123c2cf 1955 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1956 ),
1957 'core_competency_user_competency_viewed_in_course' => array(
1958 'classname' => 'core_competency\external',
1959 'methodname' => 'user_competency_viewed_in_course',
1960 'classpath' => '',
1961 'description' => 'Log the user competency viewed in course event',
1962 'type' => 'read',
1963 'capabilities' => 'moodle/competency:usercompetencyview',
1964 'ajax' => true,
3123c2cf 1965 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1966 ),
1967 'core_competency_user_competency_plan_viewed' => array(
1968 'classname' => 'core_competency\external',
1969 'methodname' => 'user_competency_plan_viewed',
1970 'classpath' => '',
1971 'description' => 'Log the user competency plan viewed event.',
1972 'type' => 'read',
1973 'capabilities' => 'moodle/competency:usercompetencyview',
1974 'ajax' => true,
3123c2cf 1975 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
1976 ),
1977 'core_competency_grade_competency' => array(
1978 'classname' => 'core_competency\external',
1979 'methodname' => 'grade_competency',
1980 'classpath' => '',
1981 'description' => 'Grade a competency.',
1982 'type' => 'write',
1983 'capabilities' => 'moodle/competency:competencygrade',
1984 'ajax' => true,
1985 ),
1986 'core_competency_grade_competency_in_plan' => array(
1987 'classname' => 'core_competency\external',
1988 'methodname' => 'grade_competency_in_plan',
1989 'classpath' => '',
1990 'description' => 'Grade a competency from the user plan page.',
1991 'type' => 'write',
1992 'capabilities' => 'moodle/competency:competencygrade',
1993 'ajax' => true,
1994 ),
1995 'core_competency_grade_competency_in_course' => array(
1996 'classname' => 'core_competency\external',
1997 'methodname' => 'grade_competency_in_course',
1998 'classpath' => '',
1999 'description' => 'Grade a competency from the course page.',
2000 'type' => 'write',
2001 'capabilities' => 'moodle/competency:competencygrade',
2002 'ajax' => true,
3123c2cf 2003 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
81de839f
FM
2004 ),
2005 'core_competency_unlink_plan_from_template' => array(
2006 'classname' => 'core_competency\external',
2007 'methodname' => 'unlink_plan_from_template',
2008 'classpath' => '',
2009 'description' => 'Unlink a plan form it template.',
2010 'type' => 'write',
2011 'capabilities' => 'moodle/competency:planmanage',
2012 'ajax' => true,
2013 ),
2014 'core_competency_template_viewed' => array(
2015 'classname' => 'core_competency\external',
2016 'methodname' => 'template_viewed',
2017 'classpath' => '',
2018 'description' => 'Log event template viewed',
2019 'type' => 'read',
2020 'capabilities' => 'moodle/competency:templateview',
2021 'ajax' => true,
2022 ),
2023 'core_competency_request_review_of_user_evidence_linked_competencies' => array(
2024 'classname' => 'core_competency\external',
2025 'methodname' => 'request_review_of_user_evidence_linked_competencies',
2026 'classpath' => '',
2027 'description' => 'Send user evidence competencies in review',
2028 'type' => 'write',
2029 'capabilities' => 'moodle/competency:userevidencemanageown',
2030 'ajax' => true,
2031 ),
2032 'core_competency_update_course_competency_settings' => array(
2033 'classname' => 'core_competency\external',
2034 'methodname' => 'update_course_competency_settings',
2035 'classpath' => '',
2036 'description' => 'Update the course competency settings',
2037 'type' => 'write',
2038 'capabilities' => 'moodle/competency:coursecompetencyconfigure',
2039 'ajax' => true,
2040 ),
1e99f31e
FM
2041 'core_competency_delete_evidence' => array(
2042 'classname' => 'core_competency\external',
2043 'methodname' => 'delete_evidence',
2044 'classpath' => '',
2045 'description' => 'Delete an evidence',
2046 'type' => 'write',
2047 'capabilities' => 'moodle/competency:evidencedelete',
2048 'ajax' => true,
3123c2cf 2049 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
1e99f31e 2050 ),
f23e9b6b
CB
2051
2052 'core_webservice_get_site_info' => array(
2053 'classname' => 'core_webservice_external',
2054 'methodname' => 'get_site_info',
2055 'classpath' => 'webservice/externallib.php',
2056 'description' => 'Return some site info / user info / list web service functions',
2057 'type' => 'read',
ee7295ee 2058 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
8446ba36
JL
2059 ),
2060
2061 // Blocks functions.
2062 'core_block_get_course_blocks' => array(
2063 'classname' => 'core_block_external',
2064 'methodname' => 'get_course_blocks',
2065 'description' => 'Returns blocks information for a course.',
2066 'type' => 'read',
2067 'capabilities' => '',
2068 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
2069 ),
9a0df45a 2070);
c1b65883
JM
2071
2072$services = array(
96e0194c 2073 'Moodle mobile web service' => array(
12c52b91 2074 'functions' => array(), // Unused as we add the service in each function definition, third party services would use this.
96e0194c
SH
2075 'enabled' => 0,
2076 'restrictedusers' => 0,
af03513f 2077 'shortname' => MOODLE_OFFICIAL_MOBILE_SERVICE,
106c55fb
DW
2078 'downloadfiles' => 1,
2079 'uploadfiles' => 1
96e0194c
SH
2080 ),
2081);