MDL-51324 forms: Add a new course selector
[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',
235ef57a 672 'ajax' => true,
6bb31e40 673 ),
674
740c354f
JL
675 'core_course_search_courses' => array(
676 'classname' => 'core_course_external',
677 'methodname' => 'search_courses',
678 'classpath' => 'course/externallib.php',
679 'description' => 'Search courses by (name, module, block, tag)',
680 'type' => 'read',
681 'capabilities' => '',
235ef57a 682 'ajax' => true,
740c354f
JL
683 ),
684
6bb31e40 685 'moodle_course_create_courses' => array(
3c1aa6fd 686 'classname' => 'moodle_course_external',
5d1017e1
JM
687 'methodname' => 'create_courses',
688 'classpath' => 'course/externallib.php',
3c1aa6fd 689 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_course_create_courses()',
5d1017e1
JM
690 'type' => 'write',
691 'capabilities'=> 'moodle/course:create,moodle/course:visibility',
692 ),
693
694 'core_course_create_courses' => array(
695 'classname' => 'core_course_external',
6bb31e40 696 'methodname' => 'create_courses',
697 'classpath' => 'course/externallib.php',
698 'description' => 'Create new courses',
699 'type' => 'write',
700 'capabilities'=> 'moodle/course:create,moodle/course:visibility',
701 ),
702
63a85dc7
JL
703 'core_course_delete_courses' => array(
704 'classname' => 'core_course_external',
705 'methodname' => 'delete_courses',
706 'classpath' => 'course/externallib.php',
707 'description' => 'Deletes all specified courses',
708 'type' => 'write',
709 'capabilities'=> 'moodle/course:delete',
710 ),
711
79949c1b
MN
712 'core_course_delete_modules' => array(
713 'classname' => 'core_course_external',
714 'methodname' => 'delete_modules',
715 'classpath' => 'course/externallib.php',
716 'description' => 'Deletes all specified module instances',
717 'type' => 'write',
718 'capabilities' => 'moodle/course:manageactivities'
719 ),
720
3dc1d76e
JL
721 'core_course_duplicate_course' => array(
722 'classname' => 'core_course_external',
723 'methodname' => 'duplicate_course',
724 'classpath' => 'course/externallib.php',
725 'description' => 'Duplicate an existing course (creating a new one) without user data',
726 'type' => 'write',
727 'capabilities'=> 'moodle/backup:backupcourse,moodle/restore:restorecourse,moodle/course:create',
728 ),
729
791723c3
RT
730 'core_course_update_courses' => array(
731 'classname' => 'core_course_external',
732 'methodname' => 'update_courses',
733 'classpath' => 'course/externallib.php',
734 'description' => 'Update courses',
735 'type' => 'write',
736 'capabilities'=> 'moodle/course:update,moodle/course:changecategory,moodle/course:changefullname,moodle/course:changeshortname,moodle/course:changeidnumber,moodle/course:changesummary,moodle/course:visibility',
737 ),
738
c4f7bf29
JL
739 'core_course_view_course' => array(
740 'classname' => 'core_course_external',
741 'methodname' => 'view_course',
742 'classpath' => 'course/externallib.php',
743 'description' => 'Log that the course was viewed',
744 'type' => 'write'
745 ),
746
c5158499
JL
747 'core_course_get_course_module' => array(
748 'classname' => 'core_course_external',
749 'methodname' => 'get_course_module',
750 'classpath' => 'course/externallib.php',
751 'description' => 'Return information about a course module',
752 'type' => 'read'
753 ),
c4f7bf29 754
13bb6819
JL
755 'core_course_get_course_module_by_instance' => array(
756 'classname' => 'core_course_external',
757 'methodname' => 'get_course_module_by_instance',
758 'classpath' => 'course/externallib.php',
759 'description' => 'Return information about a given module name and instance id',
760 'type' => 'read'
761 ),
762
3ec163dd
EL
763 // === course category related functions ===
764
765 'core_course_get_categories' => array(
766 'classname' => 'core_course_external',
767 'methodname' => 'get_categories',
768 'classpath' => 'course/externallib.php',
769 'description' => 'Return category details',
770 'type' => 'read',
771 'capabilities'=> 'moodle/category:viewhiddencategories',
772 ),
773
479a5db1
FS
774 'core_course_create_categories' => array(
775 'classname' => 'core_course_external',
776 'methodname' => 'create_categories',
777 'classpath' => 'course/externallib.php',
778 'description' => 'Create course categories',
779 'type' => 'write',
780 'capabilities'=> 'moodle/category:manage',
781 ),
d6ebe011 782
3ec163dd
EL
783 'core_course_update_categories' => array(
784 'classname' => 'core_course_external',
785 'methodname' => 'update_categories',
786 'classpath' => 'course/externallib.php',
787 'description' => 'Update categories',
788 'type' => 'write',
afe27edc 789 'capabilities'=> 'moodle/category:manage',
3ec163dd
EL
790 ),
791
2f951d86
FS
792 'core_course_delete_categories' => array(
793 'classname' => 'core_course_external',
794 'methodname' => 'delete_categories',
795 'classpath' => 'course/externallib.php',
796 'description' => 'Delete course categories',
797 'type' => 'write',
798 'capabilities'=> 'moodle/category:manage',
799 ),
479a5db1 800
8430d87b
JL
801 'core_course_import_course' => array(
802 'classname' => 'core_course_external',
803 'methodname' => 'import_course',
804 'classpath' => 'course/externallib.php',
805 'description' => 'Import course data from a course into another course. Does not include any user data.',
806 'type' => 'write',
807 'capabilities'=> 'moodle/backup:backuptargetimport, moodle/restore:restoretargetimport',
808 ),
809
a623b6b8
JM
810 // === message related functions ===
811
4de00da7 812 'moodle_message_send_instantmessages' => array(
3c1aa6fd
DM
813 'classname' => 'moodle_message_external',
814 'methodname' => 'send_instantmessages',
5d1017e1 815 'classpath' => 'message/externallib.php',
3c1aa6fd 816 '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
817 'type' => 'write',
818 'capabilities'=> 'moodle/site:sendmessage',
819 ),
820
821 'core_message_send_instant_messages' => array(
822 'classname' => 'core_message_external',
823 'methodname' => 'send_instant_messages',
a623b6b8 824 'classpath' => 'message/externallib.php',
4de00da7 825 'description' => 'Send instant messages',
a623b6b8
JM
826 'type' => 'write',
827 'capabilities'=> 'moodle/site:sendmessage',
828 ),
829
d6731600
FM
830 'core_message_create_contacts' => array(
831 'classname' => 'core_message_external',
832 'methodname' => 'create_contacts',
833 'classpath' => 'message/externallib.php',
834 'description' => 'Add contacts to the contact list',
835 'type' => 'write',
836 'capabilities'=> '',
837 ),
838
839 'core_message_delete_contacts' => array(
840 'classname' => 'core_message_external',
841 'methodname' => 'delete_contacts',
842 'classpath' => 'message/externallib.php',
843 'description' => 'Remove contacts from the contact list',
844 'type' => 'write',
845 'capabilities'=> '',
846 ),
847
848 'core_message_block_contacts' => array(
849 'classname' => 'core_message_external',
850 'methodname' => 'block_contacts',
851 'classpath' => 'message/externallib.php',
852 'description' => 'Block contacts',
853 'type' => 'write',
854 'capabilities'=> '',
855 ),
856
857 'core_message_unblock_contacts' => array(
858 'classname' => 'core_message_external',
859 'methodname' => 'unblock_contacts',
860 'classpath' => 'message/externallib.php',
861 'description' => 'Unblock contacts',
862 'type' => 'write',
863 'capabilities'=> '',
864 ),
865
866 'core_message_get_contacts' => array(
867 'classname' => 'core_message_external',
868 'methodname' => 'get_contacts',
869 'classpath' => 'message/externallib.php',
870 'description' => 'Retrieve the contact list',
871 'type' => 'read',
872 'capabilities'=> '',
873 ),
874
875 'core_message_search_contacts' => array(
876 'classname' => 'core_message_external',
877 'methodname' => 'search_contacts',
878 'classpath' => 'message/externallib.php',
879 'description' => 'Search for contacts',
880 'type' => 'read',
881 'capabilities'=> '',
882 ),
883
aff9da17 884 'core_message_get_messages' => array(
6ff4464b
JL
885 'classname' => 'core_message_external',
886 'methodname' => 'get_messages',
887 'classpath' => 'message/externallib.php',
127ef540 888 'description' => 'Retrieve a list of messages sent and received by a user (conversations, notifications or both)',
6ff4464b
JL
889 'type' => 'read',
890 'capabilities' => '',
aff9da17
JL
891 ),
892
60ab2e1b
JL
893 'core_message_get_blocked_users' => array(
894 'classname' => 'core_message_external',
895 'methodname' => 'get_blocked_users',
896 'classpath' => 'message/externallib.php',
897 'description' => 'Retrieve a list of users blocked',
898 'type' => 'read',
899 'capabilities' => '',
900 ),
901
a84f89ca
JL
902 'core_message_mark_message_read' => array(
903 'classname' => 'core_message_external',
904 'methodname' => 'mark_message_read',
905 'classpath' => 'message/externallib.php',
906 'description' => 'Mark a single message as read, trigger message_viewed event.',
907 'type' => 'write',
908 'capabilities' => '',
909 ),
910
419b1128
JL
911 'core_message_delete_message' => array(
912 'classname' => 'core_message_external',
913 'methodname' => 'delete_message',
914 'classpath' => 'message/externallib.php',
915 'description' => 'Deletes a message.',
916 'type' => 'write',
917 'capabilities' => 'moodle/site:deleteownmessage',
918 ),
919
8d46dabb
JM
920 // === notes related functions ===
921
922 'moodle_notes_create_notes' => array(
3c1aa6fd 923 'classname' => 'moodle_notes_external',
5d1017e1
JM
924 'methodname' => 'create_notes',
925 'classpath' => 'notes/externallib.php',
3c1aa6fd 926 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_notes_create_notes()',
5d1017e1
JM
927 'type' => 'write',
928 'capabilities'=> 'moodle/notes:manage',
929 ),
930
931 'core_notes_create_notes' => array(
932 'classname' => 'core_notes_external',
8d46dabb
JM
933 'methodname' => 'create_notes',
934 'classpath' => 'notes/externallib.php',
935 'description' => 'Create notes',
936 'type' => 'write',
937 'capabilities'=> 'moodle/notes:manage',
938 ),
939
34348b2b
JF
940 'core_notes_delete_notes' => array(
941 'classname' => 'core_notes_external',
942 'methodname' => 'delete_notes',
943 'classpath' => 'notes/externallib.php',
944 'description' => 'Delete notes',
945 'type' => 'write',
946 'capabilities'=> 'moodle/notes:manage',
947 ),
948
949 'core_notes_get_notes' => array(
950 'classname' => 'core_notes_external',
951 'methodname' => 'get_notes',
952 'classpath' => 'notes/externallib.php',
953 'description' => 'Get notes',
954 'type' => 'read',
955 'capabilities'=> 'moodle/notes:view',
956 ),
957
958 'core_notes_update_notes' => array(
959 'classname' => 'core_notes_external',
960 'methodname' => 'update_notes',
961 'classpath' => 'notes/externallib.php',
962 'description' => 'Update notes',
963 'type' => 'write',
964 'capabilities'=> 'moodle/notes:manage',
965 ),
966
a80b5518
JL
967 'core_notes_view_notes' => array(
968 'classname' => 'core_notes_external',
969 'methodname' => 'view_notes',
970 'classpath' => 'notes/externallib.php',
971 'description' => 'Simulates the web interface view of notes/index.php: trigger events.',
972 'type' => 'write',
973 'capabilities' => 'moodle/notes:view',
974 ),
975
9028d9b5
PC
976 // === grading related functions ===
977
978 'core_grading_get_definitions' => array(
979 'classname' => 'core_grading_external',
980 'methodname' => 'get_definitions',
9028d9b5
PC
981 'description' => 'Get grading definitions',
982 'type' => 'read'
983 ),
3f0ea6d8
PC
984
985 'core_grade_get_definitions' => array(
986 'classname' => 'core_grade_external',
987 'methodname' => 'get_definitions',
988 'classpath' => 'grade/externallib.php',
9028d9b5
PC
989 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_grading_get_definitions()',
990 'type' => 'read'
991 ),
992
0ff4ebb4
PC
993 'core_grading_save_definitions' => array(
994 'classname' => 'core_grading_external',
995 'methodname' => 'save_definitions',
996 'description' => 'Save grading definitions',
997 'type' => 'write'
998 ),
999
9028d9b5
PC
1000 'core_grading_get_gradingform_instances' => array(
1001 'classname' => 'core_grading_external',
1002 'methodname' => 'get_gradingform_instances',
9028d9b5 1003 'description' => 'Get grading form instances',
3f0ea6d8
PC
1004 'type' => 'read'
1005 ),
1006
0bf486a6
JM
1007 // === webservice related functions ===
1008
1009 'moodle_webservice_get_siteinfo' => array(
3c1aa6fd
DM
1010 'classname' => 'moodle_webservice_external',
1011 'methodname' => 'get_siteinfo',
5d1017e1 1012 'classpath' => 'webservice/externallib.php',
3c1aa6fd 1013 '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
1014 'type' => 'read',
1015 ),
1016
1017 'core_webservice_get_site_info' => array(
1018 'classname' => 'core_webservice_external',
1019 'methodname' => 'get_site_info',
0bf486a6
JM
1020 'classpath' => 'webservice/externallib.php',
1021 'description' => 'Return some site info / user info / list web service functions',
1022 'type' => 'read',
1023 ),
1024
11e76602
JM
1025 'core_get_string' => array(
1026 'classname' => 'core_external',
1027 'methodname' => 'get_string',
1028 'classpath' => 'lib/external/externallib.php',
1029 'description' => 'Return a translated string - similar to core get_string() call',
1030 'type' => 'read',
ba224fb4
DW
1031 'loginrequired' => false,
1032 'ajax' => true,
11e76602
JM
1033 ),
1034
1035 'core_get_strings' => array(
1036 'classname' => 'core_external',
1037 'methodname' => 'get_strings',
1038 'classpath' => 'lib/external/externallib.php',
1039 'description' => 'Return some translated strings - like several core get_string() calls',
1040 'type' => 'read',
ba224fb4
DW
1041 'loginrequired' => false,
1042 'ajax' => true,
11e76602
JM
1043 ),
1044
1045 'core_get_component_strings' => array(
1046 'classname' => 'core_external',
1047 'methodname' => 'get_component_strings',
1048 'classpath' => 'lib/external/externallib.php',
1049 'description' => 'Return all raw strings (with {$a->xxx}) for a specific component
1050 - similar to core get_component_strings() call',
1051 'type' => 'read',
ba224fb4
DW
1052 'loginrequired' => false,
1053 'ajax' => true,
11e76602 1054 ),
5e1350ab 1055
cc73ea07
AG
1056 'core_get_fragment' => array(
1057 'classname' => 'core_external',
1058 'methodname' => 'get_fragment',
1059 'classpath' => 'lib/external/externallib.php',
1060 'description' => 'Return a fragment for inclusion, such as a JavaScript page.',
1061 'type' => 'read',
cc73ea07
AG
1062 'ajax' => true,
1063 ),
1064
cdc5f978
MG
1065 'core_update_inplace_editable' => array(
1066 'classname' => 'core_external',
1067 'methodname' => 'update_inplace_editable',
1068 'classpath' => 'lib/external/externallib.php',
1069 'description' => 'Generic service to update title',
1070 'type' => 'write',
1071 'loginrequired' => true,
0346323c
AN
1072 'ajax' => true,
1073 ),
1074
1075 'core_fetch_notifications' => array(
1076 'classname' => 'core_external',
1077 'methodname' => 'fetch_notifications',
1078 'classpath' => 'lib/external/externallib.php',
1079 'description' => 'Return a list of notifications for the current session',
1080 'type' => 'read',
1081 'loginrequired' => false,
1082 'ajax' => true,
cdc5f978 1083 ),
5e1350ab
AA
1084
1085 // === Calendar related functions ===
1086
1087 'core_calendar_delete_calendar_events' => array(
1088 'classname' => 'core_calendar_external',
1089 'methodname' => 'delete_calendar_events',
1090 'description' => 'Delete calendar events',
1091 'classpath' => 'calendar/externallib.php',
1092 'type' => 'write',
1093 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
1094 ),
1095
793d3855
AA
1096
1097 'core_calendar_get_calendar_events' => array(
1098 'classname' => 'core_calendar_external',
1099 'methodname' => 'get_calendar_events',
1100 'description' => 'Get calendar events',
1101 'classpath' => 'calendar/externallib.php',
1102 'type' => 'read',
1103 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
1104 ),
1105
c66dc3df
AA
1106 'core_calendar_create_calendar_events' => array(
1107 'classname' => 'core_calendar_external',
1108 'methodname' => 'create_calendar_events',
1109 'description' => 'Create calendar events',
1110 'classpath' => 'calendar/externallib.php',
1111 'type' => 'write',
1112 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
1113 ),
9bdcf579
DW
1114
1115 'core_output_load_template' => array(
1116 'classname' => 'core\output\external',
1117 'methodname' => 'load_template',
1118 'description' => 'Load a template for a renderable',
5d8c1987 1119 'type' => 'read',
ba224fb4
DW
1120 'loginrequired' => false,
1121 'ajax' => true,
9bdcf579 1122 ),
25c49a85
JL
1123
1124 // Completion related functions.
1125 'core_completion_update_activity_completion_status_manually' => array(
1126 'classname' => 'core_completion_external',
1127 'methodname' => 'update_activity_completion_status_manually',
1128 'description' => 'Update completion status for the current user in an activity, only for activities with manual tracking.',
1129 'type' => 'write',
1130 ),
6c785afa 1131
23b398fc
JL
1132 'core_completion_mark_course_self_completed' => array(
1133 'classname' => 'core_completion_external',
1134 'methodname' => 'mark_course_self_completed',
1135 'description' => 'Update the course completion status for the current user (if course self-completion is enabled).',
1136 'type' => 'write',
1137 ),
1138
6c785afa
JL
1139 'core_completion_get_activities_completion_status' => array(
1140 'classname' => 'core_completion_external',
1141 'methodname' => 'get_activities_completion_status',
1142 'description' => 'Return the activities completion status for a user in a course.',
1143 'type' => 'read',
1144 'capabilities' => '',
1145 ),
1146
1147 'core_completion_get_course_completion_status' => array(
1148 'classname' => 'core_completion_external',
1149 'methodname' => 'get_course_completion_status',
1150 'description' => 'Returns course completion status.',
1151 'type' => 'read',
1152 'capabilities' => 'report/completion:view',
1153 ),
89c3afc2 1154
db5b6971
CC
1155 // Rating functions.
1156 'core_rating_get_item_ratings' => array(
46e41e63
JL
1157 'classname' => 'core_rating_external',
1158 'methodname' => 'get_item_ratings',
1159 'description' => 'Retrieve all the ratings for an item.',
1160 'type' => 'read',
1161 'capabilities' => 'moodle/rating:view'
db5b6971 1162 ),
8e355853
MG
1163
1164 // Tag functions.
23da998f 1165 'core_tag_update_tags' => array(
8e355853
MG
1166 'classname' => 'core_tag_external',
1167 'methodname' => 'update_tags',
1168 'description' => 'Updates tags',
1169 'type' => 'write',
ba224fb4 1170 'ajax' => true
8e355853
MG
1171 ),
1172
ef4c23cc
MG
1173 'core_tag_get_tags' => array(
1174 'classname' => 'core_tag_external',
1175 'methodname' => 'get_tags',
1176 'description' => 'Gets tags by their ids',
1177 'type' => 'read',
ba224fb4 1178 'ajax' => true
ef4c23cc
MG
1179 ),
1180
c026a28d
MG
1181 'core_tag_get_tagindex' => array(
1182 'classname' => 'core_tag_external',
1183 'methodname' => 'get_tagindex',
1184 'description' => 'Gets tag index page for one tag and one tag area',
1185 'type' => 'read',
1186 'ajax' => true
1187 ),
1188
9a0df45a 1189);
c1b65883
JM
1190
1191$services = array(
96e0194c
SH
1192 'Moodle mobile web service' => array(
1193 'functions' => array (
1194 'moodle_enrol_get_users_courses',
1195 'moodle_enrol_get_enrolled_users',
f2806b9a
JM
1196 'moodle_user_get_users_by_id',
1197 'moodle_webservice_get_siteinfo',
1198 'moodle_notes_create_notes',
ea4e96c2 1199 'moodle_user_get_course_participants_by_id',
01479290 1200 'moodle_user_get_users_by_courseid',
ec0d6ea2 1201 'moodle_message_send_instantmessages',
11e76602 1202 'core_course_get_contents',
6a403810 1203 'core_get_component_strings',
925f4d6b 1204 'core_user_add_user_device',
cb9d8257
JL
1205 'core_calendar_get_calendar_events',
1206 'core_enrol_get_users_courses',
1207 'core_enrol_get_enrolled_users',
b8fbbc44 1208 'core_enrol_get_course_enrolment_methods',
1e5241a1 1209 'enrol_guest_get_instance_info',
e8ad99ab 1210 'enrol_self_enrol_user',
90d50ad4 1211 'enrol_self_get_instance_info',
cb9d8257
JL
1212 'core_user_get_users_by_id',
1213 'core_webservice_get_site_info',
1214 'core_notes_create_notes',
bc7b1a3d 1215 'core_notes_delete_notes',
cb9d8257 1216 'core_user_get_course_user_profiles',
ba1dc597
JL
1217 'core_message_send_instant_messages',
1218 'mod_assign_get_grades',
1219 'mod_assign_get_assignments',
1220 'mod_assign_get_submissions',
1221 'mod_assign_get_user_flags',
1222 'mod_assign_set_user_flags',
1223 'mod_assign_get_user_mappings',
1224 'mod_assign_revert_submissions_to_draft',
1225 'mod_assign_lock_submissions',
1226 'mod_assign_unlock_submissions',
1227 'mod_assign_save_submission',
1228 'mod_assign_submit_for_grading',
1229 'mod_assign_save_grade',
1230 'mod_assign_save_user_extensions',
6acfacfa
JL
1231 'mod_assign_reveal_identities',
1232 'message_airnotifier_is_system_configured',
2e04d250 1233 'message_airnotifier_are_notification_preferences_configured',
e2ede426
JL
1234 'core_grades_update_grades',
1235 'mod_forum_get_forums_by_courses',
2ce8934b 1236 'mod_forum_get_forum_discussions_paginated',
feae0f9f 1237 'mod_forum_get_forum_discussion_posts',
50a20317 1238 'mod_forum_add_discussion_post',
7ab43ac8 1239 'mod_forum_add_discussion',
04cd8ae3 1240 'mod_forum_can_add_discussion',
aff9da17 1241 'core_files_get_files',
93872873
JL
1242 'core_message_get_messages',
1243 'core_message_create_contacts',
1244 'core_message_delete_contacts',
1245 'core_message_block_contacts',
1246 'core_message_unblock_contacts',
1247 'core_message_get_contacts',
60ab2e1b 1248 'core_message_search_contacts',
3a2ba746 1249 'core_message_get_blocked_users',
5d62e813 1250 'gradereport_user_get_grades_table',
db23cd08 1251 'core_group_get_course_user_groups',
7107c2f0 1252 'core_group_get_activity_allowed_groups',
c0ef63eb 1253 'core_group_get_activity_groupmode',
db23cd08 1254 'core_user_remove_user_device',
25c49a85
JL
1255 'core_course_get_courses',
1256 'core_completion_update_activity_completion_status_manually',
23b398fc 1257 'core_completion_mark_course_self_completed',
e77a0f36
JL
1258 'mod_data_get_databases_by_courses',
1259 'core_comment_get_comments',
449a6304 1260 'mod_forum_view_forum',
c4f7bf29 1261 'core_course_view_course',
740c354f 1262 'core_course_search_courses',
c5158499 1263 'core_course_get_course_module',
13bb6819 1264 'core_course_get_course_module_by_instance',
604afeff 1265 'core_completion_get_activities_completion_status',
9857381d 1266 'core_notes_get_course_notes',
6c785afa 1267 'core_completion_get_course_completion_status',
7a334a9b 1268 'core_user_view_user_list',
a84f89ca 1269 'core_message_mark_message_read',
419b1128 1270 'core_message_delete_message',
a80b5518 1271 'core_notes_view_notes',
d508dfe7 1272 'mod_forum_view_forum_discussion',
5770f10e 1273 'core_user_view_user_profile',
1bc85767 1274 'gradereport_user_view_grade_report',
db5b6971 1275 'core_rating_get_item_ratings',
752036b8 1276 'mod_url_view_url',
ceac202f 1277 'core_user_get_users_by_field',
32fb60e7 1278 'core_user_add_user_private_files',
e0d6d10a 1279 'mod_assign_view_grading_table',
e3e036ee 1280 'mod_assign_view_submission_status',
e9bf3011 1281 'mod_scorm_view_scorm',
dfe927c8 1282 'mod_scorm_get_scorm_scoes',
822e9df7 1283 'mod_scorm_get_scorm_user_data',
6b4ceb24 1284 'mod_scorm_insert_scorm_tracks',
6b5e69eb 1285 'mod_scorm_get_scorm_sco_tracks',
22de67f4 1286 'mod_scorm_get_scorm_attempt_count',
91ea3678 1287 'mod_scorm_get_scorms_by_courses',
98fff78d 1288 'mod_scorm_launch_sco',
a2926eb3 1289 'mod_survey_get_surveys_by_courses',
75516809 1290 'mod_survey_view_survey',
f772b515 1291 'mod_survey_get_questions',
55dca60f 1292 'mod_survey_submit_answers',
09188110 1293 'mod_page_view_page',
3c779961 1294 'mod_resource_view_resource',
734c7452 1295 'mod_folder_view_folder',
1ca4cdf3 1296 'mod_chat_login_user',
e4076a6e 1297 'mod_chat_get_chat_users',
874aa80f 1298 'mod_chat_send_chat_message',
8380bc7f 1299 'mod_chat_get_chat_latest_messages',
5841b9d5 1300 'mod_chat_view_chat',
9f7de631 1301 'mod_chat_get_chats_by_courses',
6c9b2bb5 1302 'mod_book_view_book',
580a14c2 1303 'mod_book_get_books_by_courses',
b87f31db 1304 'mod_choice_get_choice_results',
565528ce 1305 'mod_choice_get_choice_options',
10064594 1306 'mod_choice_submit_choice_response',
4c4d3b73 1307 'mod_choice_view_choice',
f07a2bb0 1308 'mod_choice_get_choices_by_courses',
4b93c3e3 1309 'mod_choice_delete_choice_responses',
ae67efa8 1310 'mod_lti_get_tool_launch_data',
dfcdec12 1311 'mod_lti_get_ltis_by_courses',
4bed1682 1312 'mod_lti_view_lti',
e648d036 1313 'mod_imscp_view_imscp',
bae627b2 1314 'mod_imscp_get_imscps_by_courses',
51e27aac 1315 'mod_quiz_get_quizzes_by_courses',
4064dd0e 1316 'mod_quiz_view_quiz',
23da998f 1317 'mod_glossary_get_glossaries_by_courses',
23cbaefb 1318 'mod_wiki_get_wikis_by_courses',
557b58b0
DP
1319 'mod_wiki_view_wiki',
1320 'mod_wiki_view_page',
44f1b701 1321 'mod_wiki_get_subwikis',
d0d4372c 1322 'mod_glossary_view_glossary',
61fce284 1323 'mod_glossary_view_entry',
fe11f9a4 1324 'mod_glossary_get_entries_by_letter',
bca824f7
FM
1325 'mod_glossary_get_entries_by_date',
1326 'mod_glossary_get_categories',
1327 'mod_glossary_get_entries_by_category',
1328 'mod_glossary_get_authors',
1329 'mod_glossary_get_entries_by_author',
1330 'mod_glossary_get_entries_by_author_id',
1331 'mod_glossary_get_entries_by_search',
1332 'mod_glossary_get_entries_by_term',
1333 'mod_glossary_get_entries_to_approve',
1334 'mod_glossary_get_entry_by_id',
60ab2e1b 1335 ),
96e0194c
SH
1336 'enabled' => 0,
1337 'restrictedusers' => 0,
af03513f 1338 'shortname' => MOODLE_OFFICIAL_MOBILE_SERVICE,
106c55fb
DW
1339 'downloadfiles' => 1,
1340 'uploadfiles' => 1
96e0194c
SH
1341 ),
1342);