MDL-53700 competency: Migrating tests to core
[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(
ef22c1b6 37
088645e2
AB
38 // Cohort related functions.
39
40 'core_cohort_create_cohorts' => array(
41 'classname' => 'core_cohort_external',
42 'methodname' => 'create_cohorts',
43 'classpath' => 'cohort/externallib.php',
44 'description' => 'Creates new cohorts.',
45 'type' => 'write',
46 'capabilities'=> 'moodle/cohort:manage',
47 ),
48
49 'core_cohort_delete_cohorts' => array(
50 'classname' => 'core_cohort_external',
51 'methodname' => 'delete_cohorts',
52 'classpath' => 'cohort/externallib.php',
53 'description' => 'Deletes all specified cohorts.',
54 'type' => 'delete',
55 'capabilities'=> 'moodle/cohort:manage',
56 ),
57
58 'core_cohort_get_cohorts' => array(
59 'classname' => 'core_cohort_external',
60 'methodname' => 'get_cohorts',
61 'classpath' => 'cohort/externallib.php',
62 'description' => 'Returns cohort details.',
63 'type' => 'read',
64 'capabilities'=> 'moodle/cohort:view',
65 ),
66
67 'core_cohort_update_cohorts' => array(
68 'classname' => 'core_cohort_external',
69 'methodname' => 'update_cohorts',
70 'classpath' => 'cohort/externallib.php',
71 'description' => 'Updates existing cohorts.',
72 'type' => 'write',
73 'capabilities'=> 'moodle/cohort:manage',
74 ),
75
76 'core_cohort_add_cohort_members' => array(
77 'classname' => 'core_cohort_external',
78 'methodname' => 'add_cohort_members',
79 'classpath' => 'cohort/externallib.php',
80 'description' => 'Adds cohort members.',
81 'type' => 'write',
82 'capabilities'=> 'moodle/cohort:assign',
83 ),
84
85 'core_cohort_delete_cohort_members' => array(
86 'classname' => 'core_cohort_external',
87 'methodname' => 'delete_cohort_members',
88 'classpath' => 'cohort/externallib.php',
89 'description' => 'Deletes cohort members.',
90 'type' => 'delete',
91 'capabilities'=> 'moodle/cohort:assign',
92 ),
93
94 'core_cohort_get_cohort_members' => array(
95 'classname' => 'core_cohort_external',
96 'methodname' => 'get_cohort_members',
97 'classpath' => 'cohort/externallib.php',
98 'description' => 'Returns cohort members.',
99 'type' => 'read',
100 'capabilities'=> 'moodle/cohort:view',
101 ),
604afeff 102
be985416
CC
103 // Comments related functions.
104
105 'core_comment_get_comments' => array(
e77a0f36
JL
106 'classname' => 'core_comment_external',
107 'methodname' => 'get_comments',
108 'description' => 'Returns comments.',
109 'type' => 'read',
110 'capabilities' => 'moodle/comment:view',
111 ),
112
198e802f 113 // Grade related functions.
d3549931 114
198e802f
JL
115 'core_grades_get_grades' => array(
116 'classname' => 'core_grades_external',
117 'methodname' => 'get_grades',
a0095e5a
JL
118 'description' => 'Returns student course total grade and grades for activities.
119 This function does not return category or manual items.
120 This function is suitable for managers or teachers not students.',
198e802f 121 'type' => 'read',
a0095e5a 122 'capabilities' => 'moodle/grade:view, moodle/grade:viewall, moodle/grade:viewhidden',
d3549931
AD
123 ),
124
198e802f
JL
125 'core_grades_update_grades' => array(
126 'classname' => 'core_grades_external',
127 'methodname' => 'update_grades',
198e802f
JL
128 'description' => 'Update a grade item and associated student grades.',
129 'type' => 'write',
130 'capabilities' => '',
d3549931 131 ),
088645e2 132
ef22c1b6 133 // === group related functions ===
f5072177 134
9a0df45a 135 'moodle_group_create_groups' => array(
3c1aa6fd 136 'classname' => 'moodle_group_external',
5d1017e1
JM
137 'methodname' => 'create_groups',
138 'classpath' => 'group/externallib.php',
3c1aa6fd 139 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_group_create_groups(). ',
5d1017e1
JM
140 'type' => 'write',
141 'capabilities'=> 'moodle/course:managegroups',
142 ),
143
144 'core_group_create_groups' => array(
145 'classname' => 'core_group_external',
9a0df45a 146 'methodname' => 'create_groups',
147 'classpath' => 'group/externallib.php',
f5072177 148 'description' => 'Creates new groups.',
149 'type' => 'write',
72f68b51 150 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 151 ),
f5072177 152
9a0df45a 153 'moodle_group_get_groups' => array(
3c1aa6fd 154 'classname' => 'moodle_group_external',
5d1017e1
JM
155 'methodname' => 'get_groups',
156 'classpath' => 'group/externallib.php',
3c1aa6fd 157 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_group_get_groups()',
5d1017e1
JM
158 'type' => 'read',
159 'capabilities'=> 'moodle/course:managegroups',
160 ),
161
162 'core_group_get_groups' => array(
163 'classname' => 'core_group_external',
9a0df45a 164 'methodname' => 'get_groups',
165 'classpath' => 'group/externallib.php',
cfb99b75 166 'description' => 'Returns group details.',
f5072177 167 'type' => 'read',
72f68b51 168 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 169 ),
246f6da2 170
171 'moodle_group_get_course_groups' => array(
3c1aa6fd 172 'classname' => 'moodle_group_external',
5d1017e1
JM
173 'methodname' => 'get_course_groups',
174 'classpath' => 'group/externallib.php',
3c1aa6fd 175 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_group_get_course_groups()',
5d1017e1
JM
176 'type' => 'read',
177 'capabilities'=> 'moodle/course:managegroups',
178 ),
179
180 'core_group_get_course_groups' => array(
181 'classname' => 'core_group_external',
246f6da2 182 'methodname' => 'get_course_groups',
183 'classpath' => 'group/externallib.php',
184 'description' => 'Returns all groups in specified course.',
185 'type' => 'read',
72f68b51 186 'capabilities'=> 'moodle/course:managegroups',
246f6da2 187 ),
2cb1ee78 188
9a0df45a 189 'moodle_group_delete_groups' => array(
3c1aa6fd 190 'classname' => 'moodle_group_external',
5d1017e1
JM
191 'methodname' => 'delete_groups',
192 'classpath' => 'group/externallib.php',
3c1aa6fd 193 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_group_delete_groups()',
5d1017e1
JM
194 'type' => 'delete',
195 'capabilities'=> 'moodle/course:managegroups',
196 ),
197
198 'core_group_delete_groups' => array(
199 'classname' => 'core_group_external',
9a0df45a 200 'methodname' => 'delete_groups',
201 'classpath' => 'group/externallib.php',
0f4e72de
PS
202 'description' => 'Deletes all specified groups.',
203 'type' => 'delete',
72f68b51 204 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 205 ),
c863dc38 206
9a0df45a 207 'moodle_group_get_groupmembers' => array(
3c1aa6fd
DM
208 'classname' => 'moodle_group_external',
209 'methodname' => 'get_groupmembers',
5d1017e1 210 'classpath' => 'group/externallib.php',
3c1aa6fd 211 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_group_get_group_members()',
5d1017e1
JM
212 'type' => 'read',
213 'capabilities'=> 'moodle/course:managegroups',
214 ),
215
216 'core_group_get_group_members' => array(
217 'classname' => 'core_group_external',
218 'methodname' => 'get_group_members',
9a0df45a 219 'classpath' => 'group/externallib.php',
0f4e72de
PS
220 'description' => 'Returns group members.',
221 'type' => 'read',
72f68b51 222 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 223 ),
4efa2483 224
9a0df45a 225 'moodle_group_add_groupmembers' => array(
3c1aa6fd
DM
226 'classname' => 'moodle_group_external',
227 'methodname' => 'add_groupmembers',
5d1017e1 228 'classpath' => 'group/externallib.php',
3c1aa6fd 229 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_group_add_group_members()',
5d1017e1
JM
230 'type' => 'write',
231 'capabilities'=> 'moodle/course:managegroups',
232 ),
233
234 'core_group_add_group_members' => array(
235 'classname' => 'core_group_external',
236 'methodname' => 'add_group_members',
9a0df45a 237 'classpath' => 'group/externallib.php',
0f4e72de
PS
238 'description' => 'Adds group members.',
239 'type' => 'write',
72f68b51 240 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 241 ),
242
243 'moodle_group_delete_groupmembers' => array(
3c1aa6fd
DM
244 'classname' => 'moodle_group_external',
245 'methodname' => 'delete_groupmembers',
9a0df45a 246 'classpath' => 'group/externallib.php',
3c1aa6fd 247 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_group_delete_group_members()',
0f4e72de 248 'type' => 'delete',
72f68b51 249 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 250 ),
72f68b51 251
5d1017e1
JM
252 'core_group_delete_group_members' => array(
253 'classname' => 'core_group_external',
254 'methodname' => 'delete_group_members',
255 'classpath' => 'group/externallib.php',
256 'description' => 'Deletes group members.',
257 'type' => 'delete',
258 'capabilities'=> 'moodle/course:managegroups',
259 ),
72f68b51 260
7ce23590
JL
261 'core_group_create_groupings' => array(
262 'classname' => 'core_group_external',
263 'methodname' => 'create_groupings',
264 'classpath' => 'group/externallib.php',
265 'description' => 'Creates new groupings',
266 'type' => 'write',
267 ),
268
269 'core_group_update_groupings' => array(
270 'classname' => 'core_group_external',
271 'methodname' => 'update_groupings',
272 'classpath' => 'group/externallib.php',
273 'description' => 'Updates existing groupings',
274 'type' => 'write',
275 ),
276
277 'core_group_get_groupings' => array(
278 'classname' => 'core_group_external',
279 'methodname' => 'get_groupings',
280 'classpath' => 'group/externallib.php',
281 'description' => 'Returns groupings details.',
282 'type' => 'read',
283 ),
284
285 'core_group_get_course_groupings' => array(
67aa60f9
JL
286 'classname' => 'core_group_external',
287 'methodname' => 'get_course_groupings',
288 'classpath' => 'group/externallib.php',
289 'description' => 'Returns all groupings in specified course.',
290 'type' => 'read',
7ce23590
JL
291 ),
292
293 'core_group_delete_groupings' => array(
67aa60f9
JL
294 'classname' => 'core_group_external',
295 'methodname' => 'delete_groupings',
296 'classpath' => 'group/externallib.php',
297 'description' => 'Deletes all specified groupings.',
298 'type' => 'write',
7ce23590
JL
299 ),
300
301 'core_group_assign_grouping' => array(
67aa60f9
JL
302 'classname' => 'core_group_external',
303 'methodname' => 'assign_grouping',
304 'classpath' => 'group/externallib.php',
305 'description' => 'Assing groups from groupings',
306 'type' => 'write',
7ce23590
JL
307 ),
308
309 'core_group_unassign_grouping' => array(
67aa60f9
JL
310 'classname' => 'core_group_external',
311 'methodname' => 'unassign_grouping',
312 'classpath' => 'group/externallib.php',
313 'description' => 'Unassing groups from groupings',
314 'type' => 'write',
7ce23590
JL
315 ),
316
5d62e813
JL
317 'core_group_get_course_user_groups' => array(
318 'classname' => 'core_group_external',
319 'methodname' => 'get_course_user_groups',
320 'classpath' => 'group/externallib.php',
321 'description' => 'Returns all groups in specified course for the specified user.',
322 'type' => 'read',
323 'capabilities' => 'moodle/course:managegroups',
324 ),
325
7107c2f0
JL
326 'core_group_get_activity_allowed_groups' => array(
327 'classname' => 'core_group_external',
328 'methodname' => 'get_activity_allowed_groups',
329 'classpath' => 'group/externallib.php',
330 'description' => 'Gets a list of groups that the user is allowed to access within the specified activity.',
331 'type' => 'read',
332 'capabilities' => '',
333 ),
334
c0ef63eb
JL
335 'core_group_get_activity_groupmode' => array(
336 'classname' => 'core_group_external',
337 'methodname' => 'get_activity_groupmode',
338 'classpath' => 'group/externallib.php',
339 'description' => 'Returns effective groupmode used in a given activity.',
340 'type' => 'read',
341 'capabilities' => '',
342 ),
343
9857381d
CC
344 'core_notes_get_course_notes' => array(
345 'classname' => 'core_notes_external',
346 'methodname' => 'get_course_notes',
7ceee324 347 'classpath' => 'notes/externallib.php',
9857381d
CC
348 'description' => 'Returns all notes in specified course (or site) for the specified user.',
349 'type' => 'read',
350 'capabilities' => 'moodle/notes:view',
351 ),
352
72f68b51 353 // === file related functions ===
354
249c4f60 355 'moodle_file_get_files' => array(
3c1aa6fd 356 'classname' => 'moodle_file_external',
5d1017e1 357 'methodname' => 'get_files',
3c1aa6fd 358 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_files_get_files()',
5d1017e1
JM
359 'type' => 'read',
360 'classpath' => 'files/externallib.php',
361 ),
362
363 'core_files_get_files' => array(
364 'classname' => 'core_files_external',
249c4f60
DC
365 'methodname' => 'get_files',
366 'description' => 'browse moodle files',
367 'type' => 'read',
368 'classpath' => 'files/externallib.php',
369 ),
5d1017e1 370
249c4f60 371 'moodle_file_upload' => array(
3c1aa6fd 372 'classname' => 'moodle_file_external',
5d1017e1 373 'methodname' => 'upload',
3c1aa6fd 374 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_files_upload()',
5d1017e1
JM
375 'type' => 'write',
376 'classpath' => 'files/externallib.php',
377 ),
378
379 'core_files_upload' => array(
380 'classname' => 'core_files_external',
249c4f60
DC
381 'methodname' => 'upload',
382 'description' => 'upload a file to moodle',
383 'type' => 'write',
384 'classpath' => 'files/externallib.php',
385 ),
4efa2483 386
ef22c1b6 387 // === user related functions ===
72f68b51 388
ef22c1b6 389 'moodle_user_create_users' => array(
3c1aa6fd 390 'classname' => 'moodle_user_external',
5d1017e1
JM
391 'methodname' => 'create_users',
392 'classpath' => 'user/externallib.php',
3c1aa6fd 393 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_user_create_users()',
5d1017e1
JM
394 'type' => 'write',
395 'capabilities'=> 'moodle/user:create',
396 ),
397
398 'core_user_create_users' => array(
399 'classname' => 'core_user_external',
ef22c1b6 400 'methodname' => 'create_users',
401 'classpath' => 'user/externallib.php',
fb79269b 402 'description' => 'Create users.',
403 'type' => 'write',
72f68b51 404 'capabilities'=> 'moodle/user:create',
ef22c1b6 405 ),
406
b0365ea5
JM
407 'core_user_get_users' => array(
408 'classname' => 'core_user_external',
409 'methodname' => 'get_users',
410 'classpath' => 'user/externallib.php',
411 'description' => 'search for users matching the parameters',
412 'type' => 'read',
413 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
414 ),
415
fb79269b 416 'moodle_user_get_users_by_id' => array(
3c1aa6fd 417 'classname' => 'moodle_user_external',
5d1017e1
JM
418 'methodname' => 'get_users_by_id',
419 'classpath' => 'user/externallib.php',
3c1aa6fd 420 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. Use core_user_get_users_by_field service instead',
5d1017e1
JM
421 'type' => 'read',
422 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
423 ),
424
c70b9853 425 'core_user_get_users_by_field' => array(
86477112 426 'classname' => 'core_user_external',
c70b9853 427 'methodname' => 'get_users_by_field',
86477112 428 'classpath' => 'user/externallib.php',
c70b9853 429 'description' => 'Retrieve users information for a specified unique field - If you want to do a user search, use core_user_get_users()',
86477112 430 'type' => 'read',
bb690849 431 'ajax' => true,
86477112
FS
432 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
433 ),
434
5d1017e1
JM
435 'core_user_get_users_by_id' => array(
436 'classname' => 'core_user_external',
fb79269b 437 'methodname' => 'get_users_by_id',
ef22c1b6 438 'classpath' => 'user/externallib.php',
41f5285f 439 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been replaced by core_user_get_users_by_field()',
fb79269b 440 'type' => 'read',
b4c74367 441 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
ef22c1b6 442 ),
443
01479290 444 'moodle_user_get_users_by_courseid' => array(
3c1aa6fd
DM
445 'classname' => 'moodle_user_external',
446 'methodname' => 'get_users_by_courseid',
447 'classpath' => 'user/externallib.php',
448 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_enrol_get_enrolled_users()',
01479290
DC
449 'type' => 'read',
450 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
451 ),
452
ea4e96c2 453 'moodle_user_get_course_participants_by_id' => array(
3c1aa6fd
DM
454 'classname' => 'moodle_user_external',
455 'methodname' => 'get_course_participants_by_id',
ea4e96c2 456 'classpath' => 'user/externallib.php',
3c1aa6fd 457 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_user_get_course_user_profiles()',
5d1017e1
JM
458 'type' => 'read',
459 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
460 ),
461
462 'core_user_get_course_user_profiles' => array(
463 'classname' => 'core_user_external',
464 'methodname' => 'get_course_user_profiles',
465 'classpath' => 'user/externallib.php',
466 'description' => 'Get course user profiles (each of the profils matching a course id and a user id).',
ea4e96c2
DC
467 'type' => 'read',
468 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
469 ),
470
ef22c1b6 471 'moodle_user_delete_users' => array(
3c1aa6fd 472 'classname' => 'moodle_user_external',
5d1017e1
JM
473 'methodname' => 'delete_users',
474 'classpath' => 'user/externallib.php',
3c1aa6fd 475 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_user_delete_users()',
5d1017e1
JM
476 'type' => 'write',
477 'capabilities'=> 'moodle/user:delete',
478 ),
479
480 'core_user_delete_users' => array(
481 'classname' => 'core_user_external',
ef22c1b6 482 'methodname' => 'delete_users',
483 'classpath' => 'user/externallib.php',
fb79269b 484 'description' => 'Delete users.',
485 'type' => 'write',
72f68b51 486 'capabilities'=> 'moodle/user:delete',
ef22c1b6 487 ),
488
489 'moodle_user_update_users' => array(
3c1aa6fd 490 'classname' => 'moodle_user_external',
5d1017e1
JM
491 'methodname' => 'update_users',
492 'classpath' => 'user/externallib.php',
3c1aa6fd 493 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_user_update_users()',
5d1017e1
JM
494 'type' => 'write',
495 'capabilities'=> 'moodle/user:update',
496 ),
497
498 'core_user_update_users' => array(
499 'classname' => 'core_user_external',
ef22c1b6 500 'methodname' => 'update_users',
501 'classpath' => 'user/externallib.php',
fb79269b 502 'description' => 'Update users.',
503 'type' => 'write',
72f68b51 504 'capabilities'=> 'moodle/user:update',
ef22c1b6 505 ),
e9b66095 506
6a403810
JL
507 'core_user_add_user_device' => array(
508 'classname' => 'core_user_external',
509 'methodname' => 'add_user_device',
510 'classpath' => 'user/externallib.php',
511 'description' => 'Store mobile user devices information for PUSH Notifications.',
512 'type' => 'write',
513 'capabilities'=> '',
514 ),
515
3221718e
JL
516 'core_user_remove_user_device' => array(
517 'classname' => 'core_user_external',
518 'methodname' => 'remove_user_device',
519 'classpath' => 'user/externallib.php',
520 'description' => 'Remove a user device from the Moodle database.',
521 'type' => 'write',
522 'capabilities' => '',
523 ),
524
7a334a9b
JL
525 'core_user_view_user_list' => array(
526 'classname' => 'core_user_external',
527 'methodname' => 'view_user_list',
528 'classpath' => 'user/externallib.php',
529 'description' => 'Simulates the web-interface view of user/index.php (triggering events).',
530 'type' => 'write',
531 'capabilities' => 'moodle/course:viewparticipants',
532 ),
533
5770f10e
JL
534 'core_user_view_user_profile' => array(
535 'classname' => 'core_user_external',
536 'methodname' => 'view_user_profile',
537 'classpath' => 'user/externallib.php',
538 'description' => 'Simulates the web-interface view of user/view.php and user/profile.php (triggering events).',
539 'type' => 'write',
540 'capabilities' => 'moodle/user:viewdetails',
541 ),
542
32fb60e7
JL
543 'core_user_add_user_private_files' => array(
544 'classname' => 'core_user_external',
545 'methodname' => 'add_user_private_files',
546 'classpath' => 'user/externallib.php',
547 'description' => 'Copy files from a draft area to users private files area.',
548 'type' => 'write',
549 'capabilities' => 'moodle/user:manageownfiles',
550 ),
551
72f68b51 552 // === enrol related functions ===
d0068cd0 553
b6b6c7ac
PC
554 'core_enrol_get_enrolled_users_with_capability' => array(
555 'classname' => 'core_enrol_external',
556 'methodname' => 'get_enrolled_users_with_capability',
557 'classpath' => 'enrol/externallib.php',
558 'description' => 'For each course and capability specified, return a list of the users that are enrolled in the course
559 and have that capability',
560 'type' => 'read',
561 ),
72f68b51 562
df997f84
PS
563 'moodle_enrol_get_enrolled_users' => array(
564 'classname' => 'moodle_enrol_external',
565 'methodname' => 'get_enrolled_users',
566 'classpath' => 'enrol/externallib.php',
5d1017e1 567 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. Please use core_enrol_get_enrolled_users() (previously known as moodle_user_get_users_by_courseid).',
df997f84 568 'type' => 'read',
72f68b51 569 'capabilities'=> 'moodle/site:viewparticipants, moodle/course:viewparticipants,
570 moodle/role:review, moodle/site:accessallgroups, moodle/course:enrolreview',
df997f84 571 ),
e6acc551 572
5d1017e1
JM
573 'core_enrol_get_enrolled_users' => array(
574 'classname' => 'core_enrol_external',
575 'methodname' => 'get_enrolled_users',
576 'classpath' => 'enrol/externallib.php',
577 'description' => 'Get enrolled users by course id.',
578 'type' => 'read',
579 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
580 ),
df997f84 581
3364dbb5 582 'moodle_enrol_get_users_courses' => array(
3c1aa6fd 583 'classname' => 'moodle_enrol_external',
3364dbb5
PS
584 'methodname' => 'get_users_courses',
585 'classpath' => 'enrol/externallib.php',
3c1aa6fd 586 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_enrol_get_users_courses()',
3364dbb5
PS
587 'type' => 'read',
588 'capabilities'=> 'moodle/course:viewparticipants',
589 ),
590
5d1017e1
JM
591 'core_enrol_get_users_courses' => array(
592 'classname' => 'core_enrol_external',
593 'methodname' => 'get_users_courses',
594 'classpath' => 'enrol/externallib.php',
595 'description' => 'Get the list of courses where a user is enrolled in',
596 'type' => 'read',
597 'capabilities'=> 'moodle/course:viewparticipants',
598 ),
599
be9bf94e
RT
600 'core_enrol_get_course_enrolment_methods' => array(
601 'classname' => 'core_enrol_external',
602 'methodname' => 'get_course_enrolment_methods',
603 'classpath' => 'enrol/externallib.php',
604 'description' => 'Get the list of course enrolment methods',
605 'type' => 'read',
606 ),
607
5d1017e1
JM
608 // === Role related functions ===
609
df997f84 610 'moodle_role_assign' => array(
3c1aa6fd
DM
611 'classname' => 'moodle_enrol_external',
612 'methodname' => 'role_assign',
5d1017e1 613 'classpath' => 'enrol/externallib.php',
3c1aa6fd 614 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_role_assign_role()',
5d1017e1
JM
615 'type' => 'write',
616 'capabilities'=> 'moodle/role:assign',
617 ),
618
619 'core_role_assign_roles' => array(
620 'classname' => 'core_role_external',
621 'methodname' => 'assign_roles',
e9b66095 622 'classpath' => 'enrol/externallib.php',
df997f84 623 'description' => 'Manual role assignments.',
e9b66095 624 'type' => 'write',
72f68b51 625 'capabilities'=> 'moodle/role:assign',
e9b66095 626 ),
627
df997f84 628 'moodle_role_unassign' => array(
3c1aa6fd
DM
629 'classname' => 'moodle_enrol_external',
630 'methodname' => 'role_unassign',
5d1017e1 631 'classpath' => 'enrol/externallib.php',
3c1aa6fd 632 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_role_unassign_role()',
5d1017e1
JM
633 'type' => 'write',
634 'capabilities'=> 'moodle/role:assign',
635 ),
636
637 'core_role_unassign_roles' => array(
638 'classname' => 'core_role_external',
639 'methodname' => 'unassign_roles',
e9b66095 640 'classpath' => 'enrol/externallib.php',
df997f84 641 'description' => 'Manual role unassignments.',
e9b66095 642 'type' => 'write',
72f68b51 643 'capabilities'=> 'moodle/role:assign',
e9b66095 644 ),
5b4a78e2 645
6bb31e40 646 // === course related functions ===
647
3ec163dd 648 'core_course_get_contents' => array(
d4a246bc 649 'classname' => 'core_course_external',
3ec163dd 650 'methodname' => 'get_course_contents',
d4a246bc 651 'classpath' => 'course/externallib.php',
3ec163dd 652 'description' => 'Get course contents',
d4a246bc 653 'type' => 'read',
3ec163dd 654 'capabilities'=> 'moodle/course:update,moodle/course:viewhiddencourses',
f2229c68 655 ),
d6ebe011 656
6bb31e40 657 'moodle_course_get_courses' => array(
3c1aa6fd 658 'classname' => 'moodle_course_external',
5d1017e1
JM
659 'methodname' => 'get_courses',
660 'classpath' => 'course/externallib.php',
3c1aa6fd 661 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_course_get_courses()',
5d1017e1
JM
662 'type' => 'read',
663 'capabilities'=> 'moodle/course:view,moodle/course:update,moodle/course:viewhiddencourses',
664 ),
665
666 'core_course_get_courses' => array(
667 'classname' => 'core_course_external',
6bb31e40 668 'methodname' => 'get_courses',
669 'classpath' => 'course/externallib.php',
670 'description' => 'Return course details',
671 'type' => 'read',
672 'capabilities'=> 'moodle/course:view,moodle/course:update,moodle/course:viewhiddencourses',
235ef57a 673 'ajax' => true,
6bb31e40 674 ),
675
740c354f
JL
676 'core_course_search_courses' => array(
677 'classname' => 'core_course_external',
678 'methodname' => 'search_courses',
679 'classpath' => 'course/externallib.php',
680 'description' => 'Search courses by (name, module, block, tag)',
681 'type' => 'read',
682 'capabilities' => '',
235ef57a 683 'ajax' => true,
740c354f
JL
684 ),
685
6bb31e40 686 'moodle_course_create_courses' => array(
3c1aa6fd 687 'classname' => 'moodle_course_external',
5d1017e1
JM
688 'methodname' => 'create_courses',
689 'classpath' => 'course/externallib.php',
3c1aa6fd 690 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_course_create_courses()',
5d1017e1
JM
691 'type' => 'write',
692 'capabilities'=> 'moodle/course:create,moodle/course:visibility',
693 ),
694
695 'core_course_create_courses' => array(
696 'classname' => 'core_course_external',
6bb31e40 697 'methodname' => 'create_courses',
698 'classpath' => 'course/externallib.php',
699 'description' => 'Create new courses',
700 'type' => 'write',
701 'capabilities'=> 'moodle/course:create,moodle/course:visibility',
702 ),
703
63a85dc7
JL
704 'core_course_delete_courses' => array(
705 'classname' => 'core_course_external',
706 'methodname' => 'delete_courses',
707 'classpath' => 'course/externallib.php',
708 'description' => 'Deletes all specified courses',
709 'type' => 'write',
710 'capabilities'=> 'moodle/course:delete',
711 ),
712
79949c1b
MN
713 'core_course_delete_modules' => array(
714 'classname' => 'core_course_external',
715 'methodname' => 'delete_modules',
716 'classpath' => 'course/externallib.php',
717 'description' => 'Deletes all specified module instances',
718 'type' => 'write',
719 'capabilities' => 'moodle/course:manageactivities'
720 ),
721
3dc1d76e
JL
722 'core_course_duplicate_course' => array(
723 'classname' => 'core_course_external',
724 'methodname' => 'duplicate_course',
725 'classpath' => 'course/externallib.php',
726 'description' => 'Duplicate an existing course (creating a new one) without user data',
727 'type' => 'write',
728 'capabilities'=> 'moodle/backup:backupcourse,moodle/restore:restorecourse,moodle/course:create',
729 ),
730
791723c3
RT
731 'core_course_update_courses' => array(
732 'classname' => 'core_course_external',
733 'methodname' => 'update_courses',
734 'classpath' => 'course/externallib.php',
735 'description' => 'Update courses',
736 'type' => 'write',
737 'capabilities'=> 'moodle/course:update,moodle/course:changecategory,moodle/course:changefullname,moodle/course:changeshortname,moodle/course:changeidnumber,moodle/course:changesummary,moodle/course:visibility',
738 ),
739
c4f7bf29
JL
740 'core_course_view_course' => array(
741 'classname' => 'core_course_external',
742 'methodname' => 'view_course',
743 'classpath' => 'course/externallib.php',
744 'description' => 'Log that the course was viewed',
745 'type' => 'write'
746 ),
747
c5158499
JL
748 'core_course_get_course_module' => array(
749 'classname' => 'core_course_external',
750 'methodname' => 'get_course_module',
751 'classpath' => 'course/externallib.php',
752 'description' => 'Return information about a course module',
753 'type' => 'read'
754 ),
c4f7bf29 755
13bb6819
JL
756 'core_course_get_course_module_by_instance' => array(
757 'classname' => 'core_course_external',
758 'methodname' => 'get_course_module_by_instance',
759 'classpath' => 'course/externallib.php',
760 'description' => 'Return information about a given module name and instance id',
761 'type' => 'read'
762 ),
763
3ec163dd
EL
764 // === course category related functions ===
765
766 'core_course_get_categories' => array(
767 'classname' => 'core_course_external',
768 'methodname' => 'get_categories',
769 'classpath' => 'course/externallib.php',
770 'description' => 'Return category details',
771 'type' => 'read',
772 'capabilities'=> 'moodle/category:viewhiddencategories',
773 ),
774
479a5db1
FS
775 'core_course_create_categories' => array(
776 'classname' => 'core_course_external',
777 'methodname' => 'create_categories',
778 'classpath' => 'course/externallib.php',
779 'description' => 'Create course categories',
780 'type' => 'write',
781 'capabilities'=> 'moodle/category:manage',
782 ),
d6ebe011 783
3ec163dd
EL
784 'core_course_update_categories' => array(
785 'classname' => 'core_course_external',
786 'methodname' => 'update_categories',
787 'classpath' => 'course/externallib.php',
788 'description' => 'Update categories',
789 'type' => 'write',
afe27edc 790 'capabilities'=> 'moodle/category:manage',
3ec163dd
EL
791 ),
792
2f951d86
FS
793 'core_course_delete_categories' => array(
794 'classname' => 'core_course_external',
795 'methodname' => 'delete_categories',
796 'classpath' => 'course/externallib.php',
797 'description' => 'Delete course categories',
798 'type' => 'write',
799 'capabilities'=> 'moodle/category:manage',
800 ),
479a5db1 801
8430d87b
JL
802 'core_course_import_course' => array(
803 'classname' => 'core_course_external',
804 'methodname' => 'import_course',
805 'classpath' => 'course/externallib.php',
806 'description' => 'Import course data from a course into another course. Does not include any user data.',
807 'type' => 'write',
808 'capabilities'=> 'moodle/backup:backuptargetimport, moodle/restore:restoretargetimport',
809 ),
810
a623b6b8
JM
811 // === message related functions ===
812
4de00da7 813 'moodle_message_send_instantmessages' => array(
3c1aa6fd
DM
814 'classname' => 'moodle_message_external',
815 'methodname' => 'send_instantmessages',
5d1017e1 816 'classpath' => 'message/externallib.php',
3c1aa6fd 817 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_message_send_instant_messages()',
5d1017e1
JM
818 'type' => 'write',
819 'capabilities'=> 'moodle/site:sendmessage',
820 ),
821
822 'core_message_send_instant_messages' => array(
823 'classname' => 'core_message_external',
824 'methodname' => 'send_instant_messages',
a623b6b8 825 'classpath' => 'message/externallib.php',
4de00da7 826 'description' => 'Send instant messages',
a623b6b8
JM
827 'type' => 'write',
828 'capabilities'=> 'moodle/site:sendmessage',
829 ),
830
d6731600
FM
831 'core_message_create_contacts' => array(
832 'classname' => 'core_message_external',
833 'methodname' => 'create_contacts',
834 'classpath' => 'message/externallib.php',
835 'description' => 'Add contacts to the contact list',
836 'type' => 'write',
837 'capabilities'=> '',
838 ),
839
840 'core_message_delete_contacts' => array(
841 'classname' => 'core_message_external',
842 'methodname' => 'delete_contacts',
843 'classpath' => 'message/externallib.php',
844 'description' => 'Remove contacts from the contact list',
845 'type' => 'write',
846 'capabilities'=> '',
847 ),
848
849 'core_message_block_contacts' => array(
850 'classname' => 'core_message_external',
851 'methodname' => 'block_contacts',
852 'classpath' => 'message/externallib.php',
853 'description' => 'Block contacts',
854 'type' => 'write',
855 'capabilities'=> '',
856 ),
857
858 'core_message_unblock_contacts' => array(
859 'classname' => 'core_message_external',
860 'methodname' => 'unblock_contacts',
861 'classpath' => 'message/externallib.php',
862 'description' => 'Unblock contacts',
863 'type' => 'write',
864 'capabilities'=> '',
865 ),
866
867 'core_message_get_contacts' => array(
868 'classname' => 'core_message_external',
869 'methodname' => 'get_contacts',
870 'classpath' => 'message/externallib.php',
871 'description' => 'Retrieve the contact list',
872 'type' => 'read',
873 'capabilities'=> '',
874 ),
875
876 'core_message_search_contacts' => array(
877 'classname' => 'core_message_external',
878 'methodname' => 'search_contacts',
879 'classpath' => 'message/externallib.php',
880 'description' => 'Search for contacts',
881 'type' => 'read',
882 'capabilities'=> '',
883 ),
884
aff9da17 885 'core_message_get_messages' => array(
6ff4464b
JL
886 'classname' => 'core_message_external',
887 'methodname' => 'get_messages',
888 'classpath' => 'message/externallib.php',
127ef540 889 'description' => 'Retrieve a list of messages sent and received by a user (conversations, notifications or both)',
6ff4464b
JL
890 'type' => 'read',
891 'capabilities' => '',
aff9da17
JL
892 ),
893
60ab2e1b
JL
894 'core_message_get_blocked_users' => array(
895 'classname' => 'core_message_external',
896 'methodname' => 'get_blocked_users',
897 'classpath' => 'message/externallib.php',
898 'description' => 'Retrieve a list of users blocked',
899 'type' => 'read',
900 'capabilities' => '',
901 ),
902
a84f89ca
JL
903 'core_message_mark_message_read' => array(
904 'classname' => 'core_message_external',
905 'methodname' => 'mark_message_read',
906 'classpath' => 'message/externallib.php',
907 'description' => 'Mark a single message as read, trigger message_viewed event.',
908 'type' => 'write',
909 'capabilities' => '',
910 ),
911
419b1128
JL
912 'core_message_delete_message' => array(
913 'classname' => 'core_message_external',
914 'methodname' => 'delete_message',
915 'classpath' => 'message/externallib.php',
916 'description' => 'Deletes a message.',
917 'type' => 'write',
918 'capabilities' => 'moodle/site:deleteownmessage',
919 ),
920
8d46dabb
JM
921 // === notes related functions ===
922
923 'moodle_notes_create_notes' => array(
3c1aa6fd 924 'classname' => 'moodle_notes_external',
5d1017e1
JM
925 'methodname' => 'create_notes',
926 'classpath' => 'notes/externallib.php',
3c1aa6fd 927 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_notes_create_notes()',
5d1017e1
JM
928 'type' => 'write',
929 'capabilities'=> 'moodle/notes:manage',
930 ),
931
932 'core_notes_create_notes' => array(
933 'classname' => 'core_notes_external',
8d46dabb
JM
934 'methodname' => 'create_notes',
935 'classpath' => 'notes/externallib.php',
936 'description' => 'Create notes',
937 'type' => 'write',
938 'capabilities'=> 'moodle/notes:manage',
939 ),
940
34348b2b
JF
941 'core_notes_delete_notes' => array(
942 'classname' => 'core_notes_external',
943 'methodname' => 'delete_notes',
944 'classpath' => 'notes/externallib.php',
945 'description' => 'Delete notes',
946 'type' => 'write',
947 'capabilities'=> 'moodle/notes:manage',
948 ),
949
950 'core_notes_get_notes' => array(
951 'classname' => 'core_notes_external',
952 'methodname' => 'get_notes',
953 'classpath' => 'notes/externallib.php',
954 'description' => 'Get notes',
955 'type' => 'read',
956 'capabilities'=> 'moodle/notes:view',
957 ),
958
959 'core_notes_update_notes' => array(
960 'classname' => 'core_notes_external',
961 'methodname' => 'update_notes',
962 'classpath' => 'notes/externallib.php',
963 'description' => 'Update notes',
964 'type' => 'write',
965 'capabilities'=> 'moodle/notes:manage',
966 ),
967
a80b5518
JL
968 'core_notes_view_notes' => array(
969 'classname' => 'core_notes_external',
970 'methodname' => 'view_notes',
971 'classpath' => 'notes/externallib.php',
972 'description' => 'Simulates the web interface view of notes/index.php: trigger events.',
973 'type' => 'write',
974 'capabilities' => 'moodle/notes:view',
975 ),
976
9028d9b5
PC
977 // === grading related functions ===
978
979 'core_grading_get_definitions' => array(
980 'classname' => 'core_grading_external',
981 'methodname' => 'get_definitions',
9028d9b5
PC
982 'description' => 'Get grading definitions',
983 'type' => 'read'
984 ),
3f0ea6d8
PC
985
986 'core_grade_get_definitions' => array(
987 'classname' => 'core_grade_external',
988 'methodname' => 'get_definitions',
989 'classpath' => 'grade/externallib.php',
9028d9b5
PC
990 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_grading_get_definitions()',
991 'type' => 'read'
992 ),
993
0ff4ebb4
PC
994 'core_grading_save_definitions' => array(
995 'classname' => 'core_grading_external',
996 'methodname' => 'save_definitions',
997 'description' => 'Save grading definitions',
998 'type' => 'write'
999 ),
1000
9028d9b5
PC
1001 'core_grading_get_gradingform_instances' => array(
1002 'classname' => 'core_grading_external',
1003 'methodname' => 'get_gradingform_instances',
9028d9b5 1004 'description' => 'Get grading form instances',
3f0ea6d8
PC
1005 'type' => 'read'
1006 ),
1007
0bf486a6
JM
1008 // === webservice related functions ===
1009
1010 'moodle_webservice_get_siteinfo' => array(
3c1aa6fd
DM
1011 'classname' => 'moodle_webservice_external',
1012 'methodname' => 'get_siteinfo',
5d1017e1 1013 'classpath' => 'webservice/externallib.php',
3c1aa6fd 1014 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_webservice_get_site_info()',
5d1017e1
JM
1015 'type' => 'read',
1016 ),
1017
1018 'core_webservice_get_site_info' => array(
1019 'classname' => 'core_webservice_external',
1020 'methodname' => 'get_site_info',
0bf486a6
JM
1021 'classpath' => 'webservice/externallib.php',
1022 'description' => 'Return some site info / user info / list web service functions',
1023 'type' => 'read',
1024 ),
1025
11e76602
JM
1026 'core_get_string' => array(
1027 'classname' => 'core_external',
1028 'methodname' => 'get_string',
1029 'classpath' => 'lib/external/externallib.php',
1030 'description' => 'Return a translated string - similar to core get_string() call',
1031 'type' => 'read',
ba224fb4
DW
1032 'loginrequired' => false,
1033 'ajax' => true,
11e76602
JM
1034 ),
1035
1036 'core_get_strings' => array(
1037 'classname' => 'core_external',
1038 'methodname' => 'get_strings',
1039 'classpath' => 'lib/external/externallib.php',
1040 'description' => 'Return some translated strings - like several core get_string() calls',
1041 'type' => 'read',
ba224fb4
DW
1042 'loginrequired' => false,
1043 'ajax' => true,
11e76602
JM
1044 ),
1045
1046 'core_get_component_strings' => array(
1047 'classname' => 'core_external',
1048 'methodname' => 'get_component_strings',
1049 'classpath' => 'lib/external/externallib.php',
1050 'description' => 'Return all raw strings (with {$a->xxx}) for a specific component
1051 - similar to core get_component_strings() call',
1052 'type' => 'read',
ba224fb4
DW
1053 'loginrequired' => false,
1054 'ajax' => true,
11e76602 1055 ),
5e1350ab 1056
cc73ea07
AG
1057 'core_get_fragment' => array(
1058 'classname' => 'core_external',
1059 'methodname' => 'get_fragment',
1060 'classpath' => 'lib/external/externallib.php',
1061 'description' => 'Return a fragment for inclusion, such as a JavaScript page.',
1062 'type' => 'read',
cc73ea07
AG
1063 'ajax' => true,
1064 ),
1065
cdc5f978
MG
1066 'core_update_inplace_editable' => array(
1067 'classname' => 'core_external',
1068 'methodname' => 'update_inplace_editable',
1069 'classpath' => 'lib/external/externallib.php',
1070 'description' => 'Generic service to update title',
1071 'type' => 'write',
1072 'loginrequired' => true,
0346323c
AN
1073 'ajax' => true,
1074 ),
1075
1076 'core_fetch_notifications' => array(
1077 'classname' => 'core_external',
1078 'methodname' => 'fetch_notifications',
1079 'classpath' => 'lib/external/externallib.php',
1080 'description' => 'Return a list of notifications for the current session',
1081 'type' => 'read',
1082 'loginrequired' => false,
1083 'ajax' => true,
cdc5f978 1084 ),
5e1350ab
AA
1085
1086 // === Calendar related functions ===
1087
1088 'core_calendar_delete_calendar_events' => array(
1089 'classname' => 'core_calendar_external',
1090 'methodname' => 'delete_calendar_events',
1091 'description' => 'Delete calendar events',
1092 'classpath' => 'calendar/externallib.php',
1093 'type' => 'write',
1094 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
1095 ),
1096
793d3855
AA
1097
1098 'core_calendar_get_calendar_events' => array(
1099 'classname' => 'core_calendar_external',
1100 'methodname' => 'get_calendar_events',
1101 'description' => 'Get calendar events',
1102 'classpath' => 'calendar/externallib.php',
1103 'type' => 'read',
1104 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
1105 ),
1106
c66dc3df
AA
1107 'core_calendar_create_calendar_events' => array(
1108 'classname' => 'core_calendar_external',
1109 'methodname' => 'create_calendar_events',
1110 'description' => 'Create calendar events',
1111 'classpath' => 'calendar/externallib.php',
1112 'type' => 'write',
1113 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
1114 ),
9bdcf579
DW
1115
1116 'core_output_load_template' => array(
1117 'classname' => 'core\output\external',
1118 'methodname' => 'load_template',
1119 'description' => 'Load a template for a renderable',
5d8c1987 1120 'type' => 'read',
ba224fb4
DW
1121 'loginrequired' => false,
1122 'ajax' => true,
9bdcf579 1123 ),
25c49a85
JL
1124
1125 // Completion related functions.
1126 'core_completion_update_activity_completion_status_manually' => array(
1127 'classname' => 'core_completion_external',
1128 'methodname' => 'update_activity_completion_status_manually',
1129 'description' => 'Update completion status for the current user in an activity, only for activities with manual tracking.',
1130 'type' => 'write',
1131 ),
6c785afa 1132
23b398fc
JL
1133 'core_completion_mark_course_self_completed' => array(
1134 'classname' => 'core_completion_external',
1135 'methodname' => 'mark_course_self_completed',
1136 'description' => 'Update the course completion status for the current user (if course self-completion is enabled).',
1137 'type' => 'write',
1138 ),
1139
6c785afa
JL
1140 'core_completion_get_activities_completion_status' => array(
1141 'classname' => 'core_completion_external',
1142 'methodname' => 'get_activities_completion_status',
1143 'description' => 'Return the activities completion status for a user in a course.',
1144 'type' => 'read',
1145 'capabilities' => '',
1146 ),
1147
1148 'core_completion_get_course_completion_status' => array(
1149 'classname' => 'core_completion_external',
1150 'methodname' => 'get_course_completion_status',
1151 'description' => 'Returns course completion status.',
1152 'type' => 'read',
1153 'capabilities' => 'report/completion:view',
1154 ),
89c3afc2 1155
db5b6971
CC
1156 // Rating functions.
1157 'core_rating_get_item_ratings' => array(
46e41e63
JL
1158 'classname' => 'core_rating_external',
1159 'methodname' => 'get_item_ratings',
1160 'description' => 'Retrieve all the ratings for an item.',
1161 'type' => 'read',
1162 'capabilities' => 'moodle/rating:view'
db5b6971 1163 ),
8e355853
MG
1164
1165 // Tag functions.
23da998f 1166 'core_tag_update_tags' => array(
8e355853
MG
1167 'classname' => 'core_tag_external',
1168 'methodname' => 'update_tags',
1169 'description' => 'Updates tags',
1170 'type' => 'write',
ba224fb4 1171 'ajax' => true
8e355853
MG
1172 ),
1173
ef4c23cc
MG
1174 'core_tag_get_tags' => array(
1175 'classname' => 'core_tag_external',
1176 'methodname' => 'get_tags',
1177 'description' => 'Gets tags by their ids',
1178 'type' => 'read',
ba224fb4 1179 'ajax' => true
ef4c23cc
MG
1180 ),
1181
c026a28d
MG
1182 'core_tag_get_tagindex' => array(
1183 'classname' => 'core_tag_external',
1184 'methodname' => 'get_tagindex',
1185 'description' => 'Gets tag index page for one tag and one tag area',
1186 'type' => 'read',
1187 'ajax' => true
1188 ),
1189
7361b968
PFO
1190 // Question related functions.
1191 'core_question_update_flag' => array(
1192 'classname' => 'core_question_external',
1193 'methodname' => 'update_flag',
1194 'description' => 'Update the flag state of a question attempt.',
1195 'type' => 'write',
1196 'capabilities' => 'moodle/question:flag',
1197 ),
1198
f4fb827e
JL
1199 // Badges functions.
1200 'core_badges_get_user_badges' => array(
1201 'classname' => 'core_badges_external',
1202 'methodname' => 'get_user_badges',
1203 'description' => 'Returns the list of badges awarded to a user.',
1204 'type' => 'read',
1205 'capabilities' => 'moodle/badges:viewotherbadges'
1206 ),
1207
9a0df45a 1208);
c1b65883
JM
1209
1210$services = array(
96e0194c
SH
1211 'Moodle mobile web service' => array(
1212 'functions' => array (
1213 'moodle_enrol_get_users_courses',
1214 'moodle_enrol_get_enrolled_users',
f2806b9a
JM
1215 'moodle_user_get_users_by_id',
1216 'moodle_webservice_get_siteinfo',
1217 'moodle_notes_create_notes',
ea4e96c2 1218 'moodle_user_get_course_participants_by_id',
01479290 1219 'moodle_user_get_users_by_courseid',
ec0d6ea2 1220 'moodle_message_send_instantmessages',
11e76602 1221 'core_course_get_contents',
6a403810 1222 'core_get_component_strings',
925f4d6b 1223 'core_user_add_user_device',
cb9d8257
JL
1224 'core_calendar_get_calendar_events',
1225 'core_enrol_get_users_courses',
1226 'core_enrol_get_enrolled_users',
b8fbbc44 1227 'core_enrol_get_course_enrolment_methods',
1e5241a1 1228 'enrol_guest_get_instance_info',
e8ad99ab 1229 'enrol_self_enrol_user',
90d50ad4 1230 'enrol_self_get_instance_info',
cb9d8257
JL
1231 'core_user_get_users_by_id',
1232 'core_webservice_get_site_info',
1233 'core_notes_create_notes',
bc7b1a3d 1234 'core_notes_delete_notes',
cb9d8257 1235 'core_user_get_course_user_profiles',
ba1dc597 1236 'core_message_send_instant_messages',
6acfacfa 1237 'message_airnotifier_is_system_configured',
2e04d250 1238 'message_airnotifier_are_notification_preferences_configured',
e2ede426 1239 'core_grades_update_grades',
aff9da17 1240 'core_files_get_files',
93872873
JL
1241 'core_message_get_messages',
1242 'core_message_create_contacts',
1243 'core_message_delete_contacts',
1244 'core_message_block_contacts',
1245 'core_message_unblock_contacts',
1246 'core_message_get_contacts',
60ab2e1b 1247 'core_message_search_contacts',
3a2ba746 1248 'core_message_get_blocked_users',
5d62e813 1249 'gradereport_user_get_grades_table',
db23cd08 1250 'core_group_get_course_user_groups',
7107c2f0 1251 'core_group_get_activity_allowed_groups',
c0ef63eb 1252 'core_group_get_activity_groupmode',
db23cd08 1253 'core_user_remove_user_device',
25c49a85
JL
1254 'core_course_get_courses',
1255 'core_completion_update_activity_completion_status_manually',
23b398fc 1256 'core_completion_mark_course_self_completed',
e77a0f36 1257 'core_comment_get_comments',
c4f7bf29 1258 'core_course_view_course',
740c354f 1259 'core_course_search_courses',
c5158499 1260 'core_course_get_course_module',
13bb6819 1261 'core_course_get_course_module_by_instance',
604afeff 1262 'core_completion_get_activities_completion_status',
9857381d 1263 'core_notes_get_course_notes',
6c785afa 1264 'core_completion_get_course_completion_status',
7a334a9b 1265 'core_user_view_user_list',
a84f89ca 1266 'core_message_mark_message_read',
419b1128 1267 'core_message_delete_message',
a80b5518 1268 'core_notes_view_notes',
5770f10e 1269 'core_user_view_user_profile',
1bc85767 1270 'gradereport_user_view_grade_report',
db5b6971 1271 'core_rating_get_item_ratings',
ceac202f 1272 'core_user_get_users_by_field',
32fb60e7 1273 'core_user_add_user_private_files',
f4fb827e
JL
1274 'core_question_update_flag',
1275 'core_badges_get_user_badges',
1276 ),
96e0194c
SH
1277 'enabled' => 0,
1278 'restrictedusers' => 0,
af03513f 1279 'shortname' => MOODLE_OFFICIAL_MOBILE_SERVICE,
106c55fb
DW
1280 'downloadfiles' => 1,
1281 'uploadfiles' => 1
96e0194c
SH
1282 ),
1283);