weekly release 3.1dev
[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
FS
430 'type' => 'read',
431 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
432 ),
433
5d1017e1
JM
434 'core_user_get_users_by_id' => array(
435 'classname' => 'core_user_external',
fb79269b 436 'methodname' => 'get_users_by_id',
ef22c1b6 437 'classpath' => 'user/externallib.php',
41f5285f 438 '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 439 'type' => 'read',
b4c74367 440 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
ef22c1b6 441 ),
442
01479290 443 'moodle_user_get_users_by_courseid' => array(
3c1aa6fd
DM
444 'classname' => 'moodle_user_external',
445 'methodname' => 'get_users_by_courseid',
446 'classpath' => 'user/externallib.php',
447 '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
448 'type' => 'read',
449 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
450 ),
451
ea4e96c2 452 'moodle_user_get_course_participants_by_id' => array(
3c1aa6fd
DM
453 'classname' => 'moodle_user_external',
454 'methodname' => 'get_course_participants_by_id',
ea4e96c2 455 'classpath' => 'user/externallib.php',
3c1aa6fd 456 '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
457 'type' => 'read',
458 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
459 ),
460
461 'core_user_get_course_user_profiles' => array(
462 'classname' => 'core_user_external',
463 'methodname' => 'get_course_user_profiles',
464 'classpath' => 'user/externallib.php',
465 'description' => 'Get course user profiles (each of the profils matching a course id and a user id).',
ea4e96c2
DC
466 'type' => 'read',
467 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
468 ),
469
ef22c1b6 470 'moodle_user_delete_users' => array(
3c1aa6fd 471 'classname' => 'moodle_user_external',
5d1017e1
JM
472 'methodname' => 'delete_users',
473 'classpath' => 'user/externallib.php',
3c1aa6fd 474 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_user_delete_users()',
5d1017e1
JM
475 'type' => 'write',
476 'capabilities'=> 'moodle/user:delete',
477 ),
478
479 'core_user_delete_users' => array(
480 'classname' => 'core_user_external',
ef22c1b6 481 'methodname' => 'delete_users',
482 'classpath' => 'user/externallib.php',
fb79269b 483 'description' => 'Delete users.',
484 'type' => 'write',
72f68b51 485 'capabilities'=> 'moodle/user:delete',
ef22c1b6 486 ),
487
488 'moodle_user_update_users' => array(
3c1aa6fd 489 'classname' => 'moodle_user_external',
5d1017e1
JM
490 'methodname' => 'update_users',
491 'classpath' => 'user/externallib.php',
3c1aa6fd 492 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_user_update_users()',
5d1017e1
JM
493 'type' => 'write',
494 'capabilities'=> 'moodle/user:update',
495 ),
496
497 'core_user_update_users' => array(
498 'classname' => 'core_user_external',
ef22c1b6 499 'methodname' => 'update_users',
500 'classpath' => 'user/externallib.php',
fb79269b 501 'description' => 'Update users.',
502 'type' => 'write',
72f68b51 503 'capabilities'=> 'moodle/user:update',
ef22c1b6 504 ),
e9b66095 505
6a403810
JL
506 'core_user_add_user_device' => array(
507 'classname' => 'core_user_external',
508 'methodname' => 'add_user_device',
509 'classpath' => 'user/externallib.php',
510 'description' => 'Store mobile user devices information for PUSH Notifications.',
511 'type' => 'write',
512 'capabilities'=> '',
513 ),
514
3221718e
JL
515 'core_user_remove_user_device' => array(
516 'classname' => 'core_user_external',
517 'methodname' => 'remove_user_device',
518 'classpath' => 'user/externallib.php',
519 'description' => 'Remove a user device from the Moodle database.',
520 'type' => 'write',
521 'capabilities' => '',
522 ),
523
7a334a9b
JL
524 'core_user_view_user_list' => array(
525 'classname' => 'core_user_external',
526 'methodname' => 'view_user_list',
527 'classpath' => 'user/externallib.php',
528 'description' => 'Simulates the web-interface view of user/index.php (triggering events).',
529 'type' => 'write',
530 'capabilities' => 'moodle/course:viewparticipants',
531 ),
532
5770f10e
JL
533 'core_user_view_user_profile' => array(
534 'classname' => 'core_user_external',
535 'methodname' => 'view_user_profile',
536 'classpath' => 'user/externallib.php',
537 'description' => 'Simulates the web-interface view of user/view.php and user/profile.php (triggering events).',
538 'type' => 'write',
539 'capabilities' => 'moodle/user:viewdetails',
540 ),
541
32fb60e7
JL
542 'core_user_add_user_private_files' => array(
543 'classname' => 'core_user_external',
544 'methodname' => 'add_user_private_files',
545 'classpath' => 'user/externallib.php',
546 'description' => 'Copy files from a draft area to users private files area.',
547 'type' => 'write',
548 'capabilities' => 'moodle/user:manageownfiles',
549 ),
550
72f68b51 551 // === enrol related functions ===
d0068cd0 552
b6b6c7ac
PC
553 'core_enrol_get_enrolled_users_with_capability' => array(
554 'classname' => 'core_enrol_external',
555 'methodname' => 'get_enrolled_users_with_capability',
556 'classpath' => 'enrol/externallib.php',
557 'description' => 'For each course and capability specified, return a list of the users that are enrolled in the course
558 and have that capability',
559 'type' => 'read',
560 ),
72f68b51 561
df997f84
PS
562 'moodle_enrol_get_enrolled_users' => array(
563 'classname' => 'moodle_enrol_external',
564 'methodname' => 'get_enrolled_users',
565 'classpath' => 'enrol/externallib.php',
5d1017e1 566 '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 567 'type' => 'read',
72f68b51 568 'capabilities'=> 'moodle/site:viewparticipants, moodle/course:viewparticipants,
569 moodle/role:review, moodle/site:accessallgroups, moodle/course:enrolreview',
df997f84 570 ),
e6acc551 571
5d1017e1
JM
572 'core_enrol_get_enrolled_users' => array(
573 'classname' => 'core_enrol_external',
574 'methodname' => 'get_enrolled_users',
575 'classpath' => 'enrol/externallib.php',
576 'description' => 'Get enrolled users by course id.',
577 'type' => 'read',
578 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
579 ),
df997f84 580
3364dbb5 581 'moodle_enrol_get_users_courses' => array(
3c1aa6fd 582 'classname' => 'moodle_enrol_external',
3364dbb5
PS
583 'methodname' => 'get_users_courses',
584 'classpath' => 'enrol/externallib.php',
3c1aa6fd 585 '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
586 'type' => 'read',
587 'capabilities'=> 'moodle/course:viewparticipants',
588 ),
589
5d1017e1
JM
590 'core_enrol_get_users_courses' => array(
591 'classname' => 'core_enrol_external',
592 'methodname' => 'get_users_courses',
593 'classpath' => 'enrol/externallib.php',
594 'description' => 'Get the list of courses where a user is enrolled in',
595 'type' => 'read',
596 'capabilities'=> 'moodle/course:viewparticipants',
597 ),
598
be9bf94e
RT
599 'core_enrol_get_course_enrolment_methods' => array(
600 'classname' => 'core_enrol_external',
601 'methodname' => 'get_course_enrolment_methods',
602 'classpath' => 'enrol/externallib.php',
603 'description' => 'Get the list of course enrolment methods',
604 'type' => 'read',
605 ),
606
5d1017e1
JM
607 // === Role related functions ===
608
df997f84 609 'moodle_role_assign' => array(
3c1aa6fd
DM
610 'classname' => 'moodle_enrol_external',
611 'methodname' => 'role_assign',
5d1017e1 612 'classpath' => 'enrol/externallib.php',
3c1aa6fd 613 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_role_assign_role()',
5d1017e1
JM
614 'type' => 'write',
615 'capabilities'=> 'moodle/role:assign',
616 ),
617
618 'core_role_assign_roles' => array(
619 'classname' => 'core_role_external',
620 'methodname' => 'assign_roles',
e9b66095 621 'classpath' => 'enrol/externallib.php',
df997f84 622 'description' => 'Manual role assignments.',
e9b66095 623 'type' => 'write',
72f68b51 624 'capabilities'=> 'moodle/role:assign',
e9b66095 625 ),
626
df997f84 627 'moodle_role_unassign' => array(
3c1aa6fd
DM
628 'classname' => 'moodle_enrol_external',
629 'methodname' => 'role_unassign',
5d1017e1 630 'classpath' => 'enrol/externallib.php',
3c1aa6fd 631 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_role_unassign_role()',
5d1017e1
JM
632 'type' => 'write',
633 'capabilities'=> 'moodle/role:assign',
634 ),
635
636 'core_role_unassign_roles' => array(
637 'classname' => 'core_role_external',
638 'methodname' => 'unassign_roles',
e9b66095 639 'classpath' => 'enrol/externallib.php',
df997f84 640 'description' => 'Manual role unassignments.',
e9b66095 641 'type' => 'write',
72f68b51 642 'capabilities'=> 'moodle/role:assign',
e9b66095 643 ),
5b4a78e2 644
6bb31e40 645 // === course related functions ===
646
3ec163dd 647 'core_course_get_contents' => array(
d4a246bc 648 'classname' => 'core_course_external',
3ec163dd 649 'methodname' => 'get_course_contents',
d4a246bc 650 'classpath' => 'course/externallib.php',
3ec163dd 651 'description' => 'Get course contents',
d4a246bc 652 'type' => 'read',
3ec163dd 653 'capabilities'=> 'moodle/course:update,moodle/course:viewhiddencourses',
f2229c68 654 ),
d6ebe011 655
6bb31e40 656 'moodle_course_get_courses' => array(
3c1aa6fd 657 'classname' => 'moodle_course_external',
5d1017e1
JM
658 'methodname' => 'get_courses',
659 'classpath' => 'course/externallib.php',
3c1aa6fd 660 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_course_get_courses()',
5d1017e1
JM
661 'type' => 'read',
662 'capabilities'=> 'moodle/course:view,moodle/course:update,moodle/course:viewhiddencourses',
663 ),
664
665 'core_course_get_courses' => array(
666 'classname' => 'core_course_external',
6bb31e40 667 'methodname' => 'get_courses',
668 'classpath' => 'course/externallib.php',
669 'description' => 'Return course details',
670 'type' => 'read',
671 'capabilities'=> 'moodle/course:view,moodle/course:update,moodle/course:viewhiddencourses',
672 ),
673
740c354f
JL
674 'core_course_search_courses' => array(
675 'classname' => 'core_course_external',
676 'methodname' => 'search_courses',
677 'classpath' => 'course/externallib.php',
678 'description' => 'Search courses by (name, module, block, tag)',
679 'type' => 'read',
680 'capabilities' => '',
681 ),
682
6bb31e40 683 'moodle_course_create_courses' => array(
3c1aa6fd 684 'classname' => 'moodle_course_external',
5d1017e1
JM
685 'methodname' => 'create_courses',
686 'classpath' => 'course/externallib.php',
3c1aa6fd 687 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_course_create_courses()',
5d1017e1
JM
688 'type' => 'write',
689 'capabilities'=> 'moodle/course:create,moodle/course:visibility',
690 ),
691
692 'core_course_create_courses' => array(
693 'classname' => 'core_course_external',
6bb31e40 694 'methodname' => 'create_courses',
695 'classpath' => 'course/externallib.php',
696 'description' => 'Create new courses',
697 'type' => 'write',
698 'capabilities'=> 'moodle/course:create,moodle/course:visibility',
699 ),
700
63a85dc7
JL
701 'core_course_delete_courses' => array(
702 'classname' => 'core_course_external',
703 'methodname' => 'delete_courses',
704 'classpath' => 'course/externallib.php',
705 'description' => 'Deletes all specified courses',
706 'type' => 'write',
707 'capabilities'=> 'moodle/course:delete',
708 ),
709
79949c1b
MN
710 'core_course_delete_modules' => array(
711 'classname' => 'core_course_external',
712 'methodname' => 'delete_modules',
713 'classpath' => 'course/externallib.php',
714 'description' => 'Deletes all specified module instances',
715 'type' => 'write',
716 'capabilities' => 'moodle/course:manageactivities'
717 ),
718
3dc1d76e
JL
719 'core_course_duplicate_course' => array(
720 'classname' => 'core_course_external',
721 'methodname' => 'duplicate_course',
722 'classpath' => 'course/externallib.php',
723 'description' => 'Duplicate an existing course (creating a new one) without user data',
724 'type' => 'write',
725 'capabilities'=> 'moodle/backup:backupcourse,moodle/restore:restorecourse,moodle/course:create',
726 ),
727
791723c3
RT
728 'core_course_update_courses' => array(
729 'classname' => 'core_course_external',
730 'methodname' => 'update_courses',
731 'classpath' => 'course/externallib.php',
732 'description' => 'Update courses',
733 'type' => 'write',
734 'capabilities'=> 'moodle/course:update,moodle/course:changecategory,moodle/course:changefullname,moodle/course:changeshortname,moodle/course:changeidnumber,moodle/course:changesummary,moodle/course:visibility',
735 ),
736
c4f7bf29
JL
737 'core_course_view_course' => array(
738 'classname' => 'core_course_external',
739 'methodname' => 'view_course',
740 'classpath' => 'course/externallib.php',
741 'description' => 'Log that the course was viewed',
742 'type' => 'write'
743 ),
744
c5158499
JL
745 'core_course_get_course_module' => array(
746 'classname' => 'core_course_external',
747 'methodname' => 'get_course_module',
748 'classpath' => 'course/externallib.php',
749 'description' => 'Return information about a course module',
750 'type' => 'read'
751 ),
c4f7bf29 752
13bb6819
JL
753 'core_course_get_course_module_by_instance' => array(
754 'classname' => 'core_course_external',
755 'methodname' => 'get_course_module_by_instance',
756 'classpath' => 'course/externallib.php',
757 'description' => 'Return information about a given module name and instance id',
758 'type' => 'read'
759 ),
760
3ec163dd
EL
761 // === course category related functions ===
762
763 'core_course_get_categories' => array(
764 'classname' => 'core_course_external',
765 'methodname' => 'get_categories',
766 'classpath' => 'course/externallib.php',
767 'description' => 'Return category details',
768 'type' => 'read',
769 'capabilities'=> 'moodle/category:viewhiddencategories',
770 ),
771
479a5db1
FS
772 'core_course_create_categories' => array(
773 'classname' => 'core_course_external',
774 'methodname' => 'create_categories',
775 'classpath' => 'course/externallib.php',
776 'description' => 'Create course categories',
777 'type' => 'write',
778 'capabilities'=> 'moodle/category:manage',
779 ),
d6ebe011 780
3ec163dd
EL
781 'core_course_update_categories' => array(
782 'classname' => 'core_course_external',
783 'methodname' => 'update_categories',
784 'classpath' => 'course/externallib.php',
785 'description' => 'Update categories',
786 'type' => 'write',
afe27edc 787 'capabilities'=> 'moodle/category:manage',
3ec163dd
EL
788 ),
789
2f951d86
FS
790 'core_course_delete_categories' => array(
791 'classname' => 'core_course_external',
792 'methodname' => 'delete_categories',
793 'classpath' => 'course/externallib.php',
794 'description' => 'Delete course categories',
795 'type' => 'write',
796 'capabilities'=> 'moodle/category:manage',
797 ),
479a5db1 798
8430d87b
JL
799 'core_course_import_course' => array(
800 'classname' => 'core_course_external',
801 'methodname' => 'import_course',
802 'classpath' => 'course/externallib.php',
803 'description' => 'Import course data from a course into another course. Does not include any user data.',
804 'type' => 'write',
805 'capabilities'=> 'moodle/backup:backuptargetimport, moodle/restore:restoretargetimport',
806 ),
807
a623b6b8
JM
808 // === message related functions ===
809
4de00da7 810 'moodle_message_send_instantmessages' => array(
3c1aa6fd
DM
811 'classname' => 'moodle_message_external',
812 'methodname' => 'send_instantmessages',
5d1017e1 813 'classpath' => 'message/externallib.php',
3c1aa6fd 814 '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
815 'type' => 'write',
816 'capabilities'=> 'moodle/site:sendmessage',
817 ),
818
819 'core_message_send_instant_messages' => array(
820 'classname' => 'core_message_external',
821 'methodname' => 'send_instant_messages',
a623b6b8 822 'classpath' => 'message/externallib.php',
4de00da7 823 'description' => 'Send instant messages',
a623b6b8
JM
824 'type' => 'write',
825 'capabilities'=> 'moodle/site:sendmessage',
826 ),
827
d6731600
FM
828 'core_message_create_contacts' => array(
829 'classname' => 'core_message_external',
830 'methodname' => 'create_contacts',
831 'classpath' => 'message/externallib.php',
832 'description' => 'Add contacts to the contact list',
833 'type' => 'write',
834 'capabilities'=> '',
835 ),
836
837 'core_message_delete_contacts' => array(
838 'classname' => 'core_message_external',
839 'methodname' => 'delete_contacts',
840 'classpath' => 'message/externallib.php',
841 'description' => 'Remove contacts from the contact list',
842 'type' => 'write',
843 'capabilities'=> '',
844 ),
845
846 'core_message_block_contacts' => array(
847 'classname' => 'core_message_external',
848 'methodname' => 'block_contacts',
849 'classpath' => 'message/externallib.php',
850 'description' => 'Block contacts',
851 'type' => 'write',
852 'capabilities'=> '',
853 ),
854
855 'core_message_unblock_contacts' => array(
856 'classname' => 'core_message_external',
857 'methodname' => 'unblock_contacts',
858 'classpath' => 'message/externallib.php',
859 'description' => 'Unblock contacts',
860 'type' => 'write',
861 'capabilities'=> '',
862 ),
863
864 'core_message_get_contacts' => array(
865 'classname' => 'core_message_external',
866 'methodname' => 'get_contacts',
867 'classpath' => 'message/externallib.php',
868 'description' => 'Retrieve the contact list',
869 'type' => 'read',
870 'capabilities'=> '',
871 ),
872
873 'core_message_search_contacts' => array(
874 'classname' => 'core_message_external',
875 'methodname' => 'search_contacts',
876 'classpath' => 'message/externallib.php',
877 'description' => 'Search for contacts',
878 'type' => 'read',
879 'capabilities'=> '',
880 ),
881
aff9da17 882 'core_message_get_messages' => array(
6ff4464b
JL
883 'classname' => 'core_message_external',
884 'methodname' => 'get_messages',
885 'classpath' => 'message/externallib.php',
127ef540 886 'description' => 'Retrieve a list of messages sent and received by a user (conversations, notifications or both)',
6ff4464b
JL
887 'type' => 'read',
888 'capabilities' => '',
aff9da17
JL
889 ),
890
60ab2e1b
JL
891 'core_message_get_blocked_users' => array(
892 'classname' => 'core_message_external',
893 'methodname' => 'get_blocked_users',
894 'classpath' => 'message/externallib.php',
895 'description' => 'Retrieve a list of users blocked',
896 'type' => 'read',
897 'capabilities' => '',
898 ),
899
a84f89ca
JL
900 'core_message_mark_message_read' => array(
901 'classname' => 'core_message_external',
902 'methodname' => 'mark_message_read',
903 'classpath' => 'message/externallib.php',
904 'description' => 'Mark a single message as read, trigger message_viewed event.',
905 'type' => 'write',
906 'capabilities' => '',
907 ),
908
419b1128
JL
909 'core_message_delete_message' => array(
910 'classname' => 'core_message_external',
911 'methodname' => 'delete_message',
912 'classpath' => 'message/externallib.php',
913 'description' => 'Deletes a message.',
914 'type' => 'write',
915 'capabilities' => 'moodle/site:deleteownmessage',
916 ),
917
8d46dabb
JM
918 // === notes related functions ===
919
920 'moodle_notes_create_notes' => array(
3c1aa6fd 921 'classname' => 'moodle_notes_external',
5d1017e1
JM
922 'methodname' => 'create_notes',
923 'classpath' => 'notes/externallib.php',
3c1aa6fd 924 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_notes_create_notes()',
5d1017e1
JM
925 'type' => 'write',
926 'capabilities'=> 'moodle/notes:manage',
927 ),
928
929 'core_notes_create_notes' => array(
930 'classname' => 'core_notes_external',
8d46dabb
JM
931 'methodname' => 'create_notes',
932 'classpath' => 'notes/externallib.php',
933 'description' => 'Create notes',
934 'type' => 'write',
935 'capabilities'=> 'moodle/notes:manage',
936 ),
937
34348b2b
JF
938 'core_notes_delete_notes' => array(
939 'classname' => 'core_notes_external',
940 'methodname' => 'delete_notes',
941 'classpath' => 'notes/externallib.php',
942 'description' => 'Delete notes',
943 'type' => 'write',
944 'capabilities'=> 'moodle/notes:manage',
945 ),
946
947 'core_notes_get_notes' => array(
948 'classname' => 'core_notes_external',
949 'methodname' => 'get_notes',
950 'classpath' => 'notes/externallib.php',
951 'description' => 'Get notes',
952 'type' => 'read',
953 'capabilities'=> 'moodle/notes:view',
954 ),
955
956 'core_notes_update_notes' => array(
957 'classname' => 'core_notes_external',
958 'methodname' => 'update_notes',
959 'classpath' => 'notes/externallib.php',
960 'description' => 'Update notes',
961 'type' => 'write',
962 'capabilities'=> 'moodle/notes:manage',
963 ),
964
a80b5518
JL
965 'core_notes_view_notes' => array(
966 'classname' => 'core_notes_external',
967 'methodname' => 'view_notes',
968 'classpath' => 'notes/externallib.php',
969 'description' => 'Simulates the web interface view of notes/index.php: trigger events.',
970 'type' => 'write',
971 'capabilities' => 'moodle/notes:view',
972 ),
973
9028d9b5
PC
974 // === grading related functions ===
975
976 'core_grading_get_definitions' => array(
977 'classname' => 'core_grading_external',
978 'methodname' => 'get_definitions',
9028d9b5
PC
979 'description' => 'Get grading definitions',
980 'type' => 'read'
981 ),
3f0ea6d8
PC
982
983 'core_grade_get_definitions' => array(
984 'classname' => 'core_grade_external',
985 'methodname' => 'get_definitions',
986 'classpath' => 'grade/externallib.php',
9028d9b5
PC
987 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_grading_get_definitions()',
988 'type' => 'read'
989 ),
990
0ff4ebb4
PC
991 'core_grading_save_definitions' => array(
992 'classname' => 'core_grading_external',
993 'methodname' => 'save_definitions',
994 'description' => 'Save grading definitions',
995 'type' => 'write'
996 ),
997
9028d9b5
PC
998 'core_grading_get_gradingform_instances' => array(
999 'classname' => 'core_grading_external',
1000 'methodname' => 'get_gradingform_instances',
9028d9b5 1001 'description' => 'Get grading form instances',
3f0ea6d8
PC
1002 'type' => 'read'
1003 ),
1004
0bf486a6
JM
1005 // === webservice related functions ===
1006
1007 'moodle_webservice_get_siteinfo' => array(
3c1aa6fd
DM
1008 'classname' => 'moodle_webservice_external',
1009 'methodname' => 'get_siteinfo',
5d1017e1 1010 'classpath' => 'webservice/externallib.php',
3c1aa6fd 1011 '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
1012 'type' => 'read',
1013 ),
1014
1015 'core_webservice_get_site_info' => array(
1016 'classname' => 'core_webservice_external',
1017 'methodname' => 'get_site_info',
0bf486a6
JM
1018 'classpath' => 'webservice/externallib.php',
1019 'description' => 'Return some site info / user info / list web service functions',
1020 'type' => 'read',
1021 ),
1022
11e76602
JM
1023 'core_get_string' => array(
1024 'classname' => 'core_external',
1025 'methodname' => 'get_string',
1026 'classpath' => 'lib/external/externallib.php',
1027 'description' => 'Return a translated string - similar to core get_string() call',
1028 'type' => 'read',
ba224fb4
DW
1029 'loginrequired' => false,
1030 'ajax' => true,
11e76602
JM
1031 ),
1032
1033 'core_get_strings' => array(
1034 'classname' => 'core_external',
1035 'methodname' => 'get_strings',
1036 'classpath' => 'lib/external/externallib.php',
1037 'description' => 'Return some translated strings - like several core get_string() calls',
1038 'type' => 'read',
ba224fb4
DW
1039 'loginrequired' => false,
1040 'ajax' => true,
11e76602
JM
1041 ),
1042
1043 'core_get_component_strings' => array(
1044 'classname' => 'core_external',
1045 'methodname' => 'get_component_strings',
1046 'classpath' => 'lib/external/externallib.php',
1047 'description' => 'Return all raw strings (with {$a->xxx}) for a specific component
1048 - similar to core get_component_strings() call',
1049 'type' => 'read',
ba224fb4
DW
1050 'loginrequired' => false,
1051 'ajax' => true,
11e76602 1052 ),
5e1350ab 1053
cc73ea07
AG
1054 'core_get_fragment' => array(
1055 'classname' => 'core_external',
1056 'methodname' => 'get_fragment',
1057 'classpath' => 'lib/external/externallib.php',
1058 'description' => 'Return a fragment for inclusion, such as a JavaScript page.',
1059 'type' => 'read',
cc73ea07
AG
1060 'ajax' => true,
1061 ),
1062
5e1350ab
AA
1063
1064 // === Calendar related functions ===
1065
1066 'core_calendar_delete_calendar_events' => array(
1067 'classname' => 'core_calendar_external',
1068 'methodname' => 'delete_calendar_events',
1069 'description' => 'Delete calendar events',
1070 'classpath' => 'calendar/externallib.php',
1071 'type' => 'write',
1072 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
1073 ),
1074
793d3855
AA
1075
1076 'core_calendar_get_calendar_events' => array(
1077 'classname' => 'core_calendar_external',
1078 'methodname' => 'get_calendar_events',
1079 'description' => 'Get calendar events',
1080 'classpath' => 'calendar/externallib.php',
1081 'type' => 'read',
1082 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
1083 ),
1084
c66dc3df
AA
1085 'core_calendar_create_calendar_events' => array(
1086 'classname' => 'core_calendar_external',
1087 'methodname' => 'create_calendar_events',
1088 'description' => 'Create calendar events',
1089 'classpath' => 'calendar/externallib.php',
1090 'type' => 'write',
1091 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
1092 ),
9bdcf579
DW
1093
1094 'core_output_load_template' => array(
1095 'classname' => 'core\output\external',
1096 'methodname' => 'load_template',
1097 'description' => 'Load a template for a renderable',
5d8c1987 1098 'type' => 'read',
ba224fb4
DW
1099 'loginrequired' => false,
1100 'ajax' => true,
9bdcf579 1101 ),
25c49a85
JL
1102
1103 // Completion related functions.
1104 'core_completion_update_activity_completion_status_manually' => array(
1105 'classname' => 'core_completion_external',
1106 'methodname' => 'update_activity_completion_status_manually',
1107 'description' => 'Update completion status for the current user in an activity, only for activities with manual tracking.',
1108 'type' => 'write',
1109 ),
6c785afa 1110
23b398fc
JL
1111 'core_completion_mark_course_self_completed' => array(
1112 'classname' => 'core_completion_external',
1113 'methodname' => 'mark_course_self_completed',
1114 'description' => 'Update the course completion status for the current user (if course self-completion is enabled).',
1115 'type' => 'write',
1116 ),
1117
6c785afa
JL
1118 'core_completion_get_activities_completion_status' => array(
1119 'classname' => 'core_completion_external',
1120 'methodname' => 'get_activities_completion_status',
1121 'description' => 'Return the activities completion status for a user in a course.',
1122 'type' => 'read',
1123 'capabilities' => '',
1124 ),
1125
1126 'core_completion_get_course_completion_status' => array(
1127 'classname' => 'core_completion_external',
1128 'methodname' => 'get_course_completion_status',
1129 'description' => 'Returns course completion status.',
1130 'type' => 'read',
1131 'capabilities' => 'report/completion:view',
1132 ),
89c3afc2 1133
db5b6971
CC
1134 // Rating functions.
1135 'core_rating_get_item_ratings' => array(
46e41e63
JL
1136 'classname' => 'core_rating_external',
1137 'methodname' => 'get_item_ratings',
1138 'description' => 'Retrieve all the ratings for an item.',
1139 'type' => 'read',
1140 'capabilities' => 'moodle/rating:view'
db5b6971 1141 ),
8e355853
MG
1142
1143 // Tag functions.
23da998f 1144 'core_tag_update_tags' => array(
8e355853
MG
1145 'classname' => 'core_tag_external',
1146 'methodname' => 'update_tags',
1147 'description' => 'Updates tags',
1148 'type' => 'write',
ba224fb4 1149 'ajax' => true
8e355853
MG
1150 ),
1151
ef4c23cc
MG
1152 'core_tag_get_tags' => array(
1153 'classname' => 'core_tag_external',
1154 'methodname' => 'get_tags',
1155 'description' => 'Gets tags by their ids',
1156 'type' => 'read',
ba224fb4 1157 'ajax' => true
ef4c23cc
MG
1158 ),
1159
c026a28d
MG
1160 'core_tag_get_tagindex' => array(
1161 'classname' => 'core_tag_external',
1162 'methodname' => 'get_tagindex',
1163 'description' => 'Gets tag index page for one tag and one tag area',
1164 'type' => 'read',
1165 'ajax' => true
1166 ),
1167
9a0df45a 1168);
c1b65883
JM
1169
1170$services = array(
96e0194c
SH
1171 'Moodle mobile web service' => array(
1172 'functions' => array (
1173 'moodle_enrol_get_users_courses',
1174 'moodle_enrol_get_enrolled_users',
f2806b9a
JM
1175 'moodle_user_get_users_by_id',
1176 'moodle_webservice_get_siteinfo',
1177 'moodle_notes_create_notes',
ea4e96c2 1178 'moodle_user_get_course_participants_by_id',
01479290 1179 'moodle_user_get_users_by_courseid',
ec0d6ea2 1180 'moodle_message_send_instantmessages',
11e76602 1181 'core_course_get_contents',
6a403810 1182 'core_get_component_strings',
925f4d6b 1183 'core_user_add_user_device',
cb9d8257
JL
1184 'core_calendar_get_calendar_events',
1185 'core_enrol_get_users_courses',
1186 'core_enrol_get_enrolled_users',
b8fbbc44 1187 'core_enrol_get_course_enrolment_methods',
1e5241a1 1188 'enrol_guest_get_instance_info',
e8ad99ab 1189 'enrol_self_enrol_user',
90d50ad4 1190 'enrol_self_get_instance_info',
cb9d8257
JL
1191 'core_user_get_users_by_id',
1192 'core_webservice_get_site_info',
1193 'core_notes_create_notes',
bc7b1a3d 1194 'core_notes_delete_notes',
cb9d8257 1195 'core_user_get_course_user_profiles',
ba1dc597
JL
1196 'core_message_send_instant_messages',
1197 'mod_assign_get_grades',
1198 'mod_assign_get_assignments',
1199 'mod_assign_get_submissions',
1200 'mod_assign_get_user_flags',
1201 'mod_assign_set_user_flags',
1202 'mod_assign_get_user_mappings',
1203 'mod_assign_revert_submissions_to_draft',
1204 'mod_assign_lock_submissions',
1205 'mod_assign_unlock_submissions',
1206 'mod_assign_save_submission',
1207 'mod_assign_submit_for_grading',
1208 'mod_assign_save_grade',
1209 'mod_assign_save_user_extensions',
6acfacfa
JL
1210 'mod_assign_reveal_identities',
1211 'message_airnotifier_is_system_configured',
2e04d250 1212 'message_airnotifier_are_notification_preferences_configured',
e2ede426
JL
1213 'core_grades_update_grades',
1214 'mod_forum_get_forums_by_courses',
2ce8934b 1215 'mod_forum_get_forum_discussions_paginated',
feae0f9f 1216 'mod_forum_get_forum_discussion_posts',
50a20317 1217 'mod_forum_add_discussion_post',
7ab43ac8 1218 'mod_forum_add_discussion',
04cd8ae3 1219 'mod_forum_can_add_discussion',
aff9da17 1220 'core_files_get_files',
93872873
JL
1221 'core_message_get_messages',
1222 'core_message_create_contacts',
1223 'core_message_delete_contacts',
1224 'core_message_block_contacts',
1225 'core_message_unblock_contacts',
1226 'core_message_get_contacts',
60ab2e1b 1227 'core_message_search_contacts',
3a2ba746 1228 'core_message_get_blocked_users',
5d62e813 1229 'gradereport_user_get_grades_table',
db23cd08 1230 'core_group_get_course_user_groups',
7107c2f0 1231 'core_group_get_activity_allowed_groups',
c0ef63eb 1232 'core_group_get_activity_groupmode',
db23cd08 1233 'core_user_remove_user_device',
25c49a85
JL
1234 'core_course_get_courses',
1235 'core_completion_update_activity_completion_status_manually',
23b398fc 1236 'core_completion_mark_course_self_completed',
e77a0f36
JL
1237 'mod_data_get_databases_by_courses',
1238 'core_comment_get_comments',
449a6304 1239 'mod_forum_view_forum',
c4f7bf29 1240 'core_course_view_course',
740c354f 1241 'core_course_search_courses',
c5158499 1242 'core_course_get_course_module',
13bb6819 1243 'core_course_get_course_module_by_instance',
604afeff 1244 'core_completion_get_activities_completion_status',
9857381d 1245 'core_notes_get_course_notes',
6c785afa 1246 'core_completion_get_course_completion_status',
7a334a9b 1247 'core_user_view_user_list',
a84f89ca 1248 'core_message_mark_message_read',
419b1128 1249 'core_message_delete_message',
a80b5518 1250 'core_notes_view_notes',
d508dfe7 1251 'mod_forum_view_forum_discussion',
5770f10e 1252 'core_user_view_user_profile',
1bc85767 1253 'gradereport_user_view_grade_report',
db5b6971 1254 'core_rating_get_item_ratings',
752036b8 1255 'mod_url_view_url',
ceac202f 1256 'core_user_get_users_by_field',
32fb60e7 1257 'core_user_add_user_private_files',
e0d6d10a 1258 'mod_assign_view_grading_table',
e9bf3011 1259 'mod_scorm_view_scorm',
dfe927c8 1260 'mod_scorm_get_scorm_scoes',
822e9df7 1261 'mod_scorm_get_scorm_user_data',
6b4ceb24 1262 'mod_scorm_insert_scorm_tracks',
6b5e69eb 1263 'mod_scorm_get_scorm_sco_tracks',
22de67f4 1264 'mod_scorm_get_scorm_attempt_count',
91ea3678 1265 'mod_scorm_get_scorms_by_courses',
98fff78d 1266 'mod_scorm_launch_sco',
a2926eb3 1267 'mod_survey_get_surveys_by_courses',
75516809 1268 'mod_survey_view_survey',
f772b515 1269 'mod_survey_get_questions',
55dca60f 1270 'mod_survey_submit_answers',
09188110 1271 'mod_page_view_page',
3c779961 1272 'mod_resource_view_resource',
734c7452 1273 'mod_folder_view_folder',
1ca4cdf3 1274 'mod_chat_login_user',
e4076a6e 1275 'mod_chat_get_chat_users',
874aa80f 1276 'mod_chat_send_chat_message',
8380bc7f 1277 'mod_chat_get_chat_latest_messages',
5841b9d5 1278 'mod_chat_view_chat',
9f7de631 1279 'mod_chat_get_chats_by_courses',
6c9b2bb5 1280 'mod_book_view_book',
580a14c2 1281 'mod_book_get_books_by_courses',
b87f31db 1282 'mod_choice_get_choice_results',
565528ce 1283 'mod_choice_get_choice_options',
10064594 1284 'mod_choice_submit_choice_response',
4c4d3b73 1285 'mod_choice_view_choice',
f07a2bb0 1286 'mod_choice_get_choices_by_courses',
4b93c3e3 1287 'mod_choice_delete_choice_responses',
ae67efa8 1288 'mod_lti_get_tool_launch_data',
dfcdec12 1289 'mod_lti_get_ltis_by_courses',
4bed1682 1290 'mod_lti_view_lti',
e648d036 1291 'mod_imscp_view_imscp',
bae627b2 1292 'mod_imscp_get_imscps_by_courses',
23da998f 1293 'mod_glossary_get_glossaries_by_courses',
23cbaefb 1294 'mod_wiki_get_wikis_by_courses',
557b58b0
DP
1295 'mod_wiki_view_wiki',
1296 'mod_wiki_view_page',
d0d4372c 1297 'mod_glossary_view_glossary',
61fce284 1298 'mod_glossary_view_entry',
fe11f9a4 1299 'mod_glossary_get_entries_by_letter',
bca824f7
FM
1300 'mod_glossary_get_entries_by_date',
1301 'mod_glossary_get_categories',
1302 'mod_glossary_get_entries_by_category',
1303 'mod_glossary_get_authors',
1304 'mod_glossary_get_entries_by_author',
1305 'mod_glossary_get_entries_by_author_id',
1306 'mod_glossary_get_entries_by_search',
1307 'mod_glossary_get_entries_by_term',
1308 'mod_glossary_get_entries_to_approve',
1309 'mod_glossary_get_entry_by_id',
60ab2e1b 1310 ),
96e0194c
SH
1311 'enabled' => 0,
1312 'restrictedusers' => 0,
af03513f 1313 'shortname' => MOODLE_OFFICIAL_MOBILE_SERVICE,
106c55fb
DW
1314 'downloadfiles' => 1,
1315 'uploadfiles' => 1
96e0194c
SH
1316 ),
1317);