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