MDL-49314 webservices: New WS get_activities_completion_status
[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 ),
5f2406c9
CC
102
103 'core_completion_get_activities_completion_status' => array(
104 'classname' => 'core_completion_external',
105 'methodname' => 'get_activities_completion_status',
106 'description' => 'Return the activities completion status for a user in a course.',
107 'type' => 'read',
108 'capabilities'=> 'moodle/progress:view',
109 ),
110
198e802f 111 // Grade related functions.
d3549931 112
198e802f
JL
113 'core_grades_get_grades' => array(
114 'classname' => 'core_grades_external',
115 'methodname' => 'get_grades',
a0095e5a
JL
116 'description' => 'Returns student course total grade and grades for activities.
117 This function does not return category or manual items.
118 This function is suitable for managers or teachers not students.',
198e802f 119 'type' => 'read',
a0095e5a 120 'capabilities' => 'moodle/grade:view, moodle/grade:viewall, moodle/grade:viewhidden',
d3549931
AD
121 ),
122
198e802f
JL
123 'core_grades_update_grades' => array(
124 'classname' => 'core_grades_external',
125 'methodname' => 'update_grades',
198e802f
JL
126 'description' => 'Update a grade item and associated student grades.',
127 'type' => 'write',
128 'capabilities' => '',
d3549931 129 ),
088645e2 130
ef22c1b6 131 // === group related functions ===
f5072177 132
9a0df45a 133 'moodle_group_create_groups' => array(
3c1aa6fd 134 'classname' => 'moodle_group_external',
5d1017e1
JM
135 'methodname' => 'create_groups',
136 'classpath' => 'group/externallib.php',
3c1aa6fd 137 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_group_create_groups(). ',
5d1017e1
JM
138 'type' => 'write',
139 'capabilities'=> 'moodle/course:managegroups',
140 ),
141
142 'core_group_create_groups' => array(
143 'classname' => 'core_group_external',
9a0df45a 144 'methodname' => 'create_groups',
145 'classpath' => 'group/externallib.php',
f5072177 146 'description' => 'Creates new groups.',
147 'type' => 'write',
72f68b51 148 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 149 ),
f5072177 150
9a0df45a 151 'moodle_group_get_groups' => array(
3c1aa6fd 152 'classname' => 'moodle_group_external',
5d1017e1
JM
153 'methodname' => 'get_groups',
154 'classpath' => 'group/externallib.php',
3c1aa6fd 155 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_group_get_groups()',
5d1017e1
JM
156 'type' => 'read',
157 'capabilities'=> 'moodle/course:managegroups',
158 ),
159
160 'core_group_get_groups' => array(
161 'classname' => 'core_group_external',
9a0df45a 162 'methodname' => 'get_groups',
163 'classpath' => 'group/externallib.php',
cfb99b75 164 'description' => 'Returns group details.',
f5072177 165 'type' => 'read',
72f68b51 166 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 167 ),
246f6da2 168
169 'moodle_group_get_course_groups' => array(
3c1aa6fd 170 'classname' => 'moodle_group_external',
5d1017e1
JM
171 'methodname' => 'get_course_groups',
172 'classpath' => 'group/externallib.php',
3c1aa6fd 173 '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
174 'type' => 'read',
175 'capabilities'=> 'moodle/course:managegroups',
176 ),
177
178 'core_group_get_course_groups' => array(
179 'classname' => 'core_group_external',
246f6da2 180 'methodname' => 'get_course_groups',
181 'classpath' => 'group/externallib.php',
182 'description' => 'Returns all groups in specified course.',
183 'type' => 'read',
72f68b51 184 'capabilities'=> 'moodle/course:managegroups',
246f6da2 185 ),
2cb1ee78 186
9a0df45a 187 'moodle_group_delete_groups' => array(
3c1aa6fd 188 'classname' => 'moodle_group_external',
5d1017e1
JM
189 'methodname' => 'delete_groups',
190 'classpath' => 'group/externallib.php',
3c1aa6fd 191 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_group_delete_groups()',
5d1017e1
JM
192 'type' => 'delete',
193 'capabilities'=> 'moodle/course:managegroups',
194 ),
195
196 'core_group_delete_groups' => array(
197 'classname' => 'core_group_external',
9a0df45a 198 'methodname' => 'delete_groups',
199 'classpath' => 'group/externallib.php',
0f4e72de
PS
200 'description' => 'Deletes all specified groups.',
201 'type' => 'delete',
72f68b51 202 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 203 ),
c863dc38 204
9a0df45a 205 'moodle_group_get_groupmembers' => array(
3c1aa6fd
DM
206 'classname' => 'moodle_group_external',
207 'methodname' => 'get_groupmembers',
5d1017e1 208 'classpath' => 'group/externallib.php',
3c1aa6fd 209 '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
210 'type' => 'read',
211 'capabilities'=> 'moodle/course:managegroups',
212 ),
213
214 'core_group_get_group_members' => array(
215 'classname' => 'core_group_external',
216 'methodname' => 'get_group_members',
9a0df45a 217 'classpath' => 'group/externallib.php',
0f4e72de
PS
218 'description' => 'Returns group members.',
219 'type' => 'read',
72f68b51 220 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 221 ),
4efa2483 222
9a0df45a 223 'moodle_group_add_groupmembers' => array(
3c1aa6fd
DM
224 'classname' => 'moodle_group_external',
225 'methodname' => 'add_groupmembers',
5d1017e1 226 'classpath' => 'group/externallib.php',
3c1aa6fd 227 '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
228 'type' => 'write',
229 'capabilities'=> 'moodle/course:managegroups',
230 ),
231
232 'core_group_add_group_members' => array(
233 'classname' => 'core_group_external',
234 'methodname' => 'add_group_members',
9a0df45a 235 'classpath' => 'group/externallib.php',
0f4e72de
PS
236 'description' => 'Adds group members.',
237 'type' => 'write',
72f68b51 238 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 239 ),
240
241 'moodle_group_delete_groupmembers' => array(
3c1aa6fd
DM
242 'classname' => 'moodle_group_external',
243 'methodname' => 'delete_groupmembers',
9a0df45a 244 'classpath' => 'group/externallib.php',
3c1aa6fd 245 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_group_delete_group_members()',
0f4e72de 246 'type' => 'delete',
72f68b51 247 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 248 ),
72f68b51 249
5d1017e1
JM
250 'core_group_delete_group_members' => array(
251 'classname' => 'core_group_external',
252 'methodname' => 'delete_group_members',
253 'classpath' => 'group/externallib.php',
254 'description' => 'Deletes group members.',
255 'type' => 'delete',
256 'capabilities'=> 'moodle/course:managegroups',
257 ),
72f68b51 258
7ce23590
JL
259 'core_group_create_groupings' => array(
260 'classname' => 'core_group_external',
261 'methodname' => 'create_groupings',
262 'classpath' => 'group/externallib.php',
263 'description' => 'Creates new groupings',
264 'type' => 'write',
265 ),
266
267 'core_group_update_groupings' => array(
268 'classname' => 'core_group_external',
269 'methodname' => 'update_groupings',
270 'classpath' => 'group/externallib.php',
271 'description' => 'Updates existing groupings',
272 'type' => 'write',
273 ),
274
275 'core_group_get_groupings' => array(
276 'classname' => 'core_group_external',
277 'methodname' => 'get_groupings',
278 'classpath' => 'group/externallib.php',
279 'description' => 'Returns groupings details.',
280 'type' => 'read',
281 ),
282
283 'core_group_get_course_groupings' => array(
67aa60f9
JL
284 'classname' => 'core_group_external',
285 'methodname' => 'get_course_groupings',
286 'classpath' => 'group/externallib.php',
287 'description' => 'Returns all groupings in specified course.',
288 'type' => 'read',
7ce23590
JL
289 ),
290
291 'core_group_delete_groupings' => array(
67aa60f9
JL
292 'classname' => 'core_group_external',
293 'methodname' => 'delete_groupings',
294 'classpath' => 'group/externallib.php',
295 'description' => 'Deletes all specified groupings.',
296 'type' => 'write',
7ce23590
JL
297 ),
298
299 'core_group_assign_grouping' => array(
67aa60f9
JL
300 'classname' => 'core_group_external',
301 'methodname' => 'assign_grouping',
302 'classpath' => 'group/externallib.php',
303 'description' => 'Assing groups from groupings',
304 'type' => 'write',
7ce23590
JL
305 ),
306
307 'core_group_unassign_grouping' => array(
67aa60f9
JL
308 'classname' => 'core_group_external',
309 'methodname' => 'unassign_grouping',
310 'classpath' => 'group/externallib.php',
311 'description' => 'Unassing groups from groupings',
312 'type' => 'write',
7ce23590
JL
313 ),
314
5d62e813
JL
315 'core_group_get_course_user_groups' => array(
316 'classname' => 'core_group_external',
317 'methodname' => 'get_course_user_groups',
318 'classpath' => 'group/externallib.php',
319 'description' => 'Returns all groups in specified course for the specified user.',
320 'type' => 'read',
321 'capabilities' => 'moodle/course:managegroups',
322 ),
323
72f68b51 324 // === file related functions ===
325
249c4f60 326 'moodle_file_get_files' => array(
3c1aa6fd 327 'classname' => 'moodle_file_external',
5d1017e1 328 'methodname' => 'get_files',
3c1aa6fd 329 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_files_get_files()',
5d1017e1
JM
330 'type' => 'read',
331 'classpath' => 'files/externallib.php',
332 ),
333
334 'core_files_get_files' => array(
335 'classname' => 'core_files_external',
249c4f60
DC
336 'methodname' => 'get_files',
337 'description' => 'browse moodle files',
338 'type' => 'read',
339 'classpath' => 'files/externallib.php',
340 ),
5d1017e1 341
249c4f60 342 'moodle_file_upload' => array(
3c1aa6fd 343 'classname' => 'moodle_file_external',
5d1017e1 344 'methodname' => 'upload',
3c1aa6fd 345 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_files_upload()',
5d1017e1
JM
346 'type' => 'write',
347 'classpath' => 'files/externallib.php',
348 ),
349
350 'core_files_upload' => array(
351 'classname' => 'core_files_external',
249c4f60
DC
352 'methodname' => 'upload',
353 'description' => 'upload a file to moodle',
354 'type' => 'write',
355 'classpath' => 'files/externallib.php',
356 ),
4efa2483 357
ef22c1b6 358 // === user related functions ===
72f68b51 359
ef22c1b6 360 'moodle_user_create_users' => array(
3c1aa6fd 361 'classname' => 'moodle_user_external',
5d1017e1
JM
362 'methodname' => 'create_users',
363 'classpath' => 'user/externallib.php',
3c1aa6fd 364 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_user_create_users()',
5d1017e1
JM
365 'type' => 'write',
366 'capabilities'=> 'moodle/user:create',
367 ),
368
369 'core_user_create_users' => array(
370 'classname' => 'core_user_external',
ef22c1b6 371 'methodname' => 'create_users',
372 'classpath' => 'user/externallib.php',
fb79269b 373 'description' => 'Create users.',
374 'type' => 'write',
72f68b51 375 'capabilities'=> 'moodle/user:create',
ef22c1b6 376 ),
377
b0365ea5
JM
378 'core_user_get_users' => array(
379 'classname' => 'core_user_external',
380 'methodname' => 'get_users',
381 'classpath' => 'user/externallib.php',
382 'description' => 'search for users matching the parameters',
383 'type' => 'read',
384 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
385 ),
386
fb79269b 387 'moodle_user_get_users_by_id' => array(
3c1aa6fd 388 'classname' => 'moodle_user_external',
5d1017e1
JM
389 'methodname' => 'get_users_by_id',
390 'classpath' => 'user/externallib.php',
3c1aa6fd 391 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. Use core_user_get_users_by_field service instead',
5d1017e1
JM
392 'type' => 'read',
393 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
394 ),
395
c70b9853 396 'core_user_get_users_by_field' => array(
86477112 397 'classname' => 'core_user_external',
c70b9853 398 'methodname' => 'get_users_by_field',
86477112 399 'classpath' => 'user/externallib.php',
c70b9853 400 'description' => 'Retrieve users information for a specified unique field - If you want to do a user search, use core_user_get_users()',
86477112
FS
401 'type' => 'read',
402 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
403 ),
404
5d1017e1
JM
405 'core_user_get_users_by_id' => array(
406 'classname' => 'core_user_external',
fb79269b 407 'methodname' => 'get_users_by_id',
ef22c1b6 408 'classpath' => 'user/externallib.php',
41f5285f 409 '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 410 'type' => 'read',
b4c74367 411 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
ef22c1b6 412 ),
413
01479290 414 'moodle_user_get_users_by_courseid' => array(
3c1aa6fd
DM
415 'classname' => 'moodle_user_external',
416 'methodname' => 'get_users_by_courseid',
417 'classpath' => 'user/externallib.php',
418 '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
419 'type' => 'read',
420 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
421 ),
422
ea4e96c2 423 'moodle_user_get_course_participants_by_id' => array(
3c1aa6fd
DM
424 'classname' => 'moodle_user_external',
425 'methodname' => 'get_course_participants_by_id',
ea4e96c2 426 'classpath' => 'user/externallib.php',
3c1aa6fd 427 '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
428 'type' => 'read',
429 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
430 ),
431
432 'core_user_get_course_user_profiles' => array(
433 'classname' => 'core_user_external',
434 'methodname' => 'get_course_user_profiles',
435 'classpath' => 'user/externallib.php',
436 'description' => 'Get course user profiles (each of the profils matching a course id and a user id).',
ea4e96c2
DC
437 'type' => 'read',
438 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
439 ),
440
ef22c1b6 441 'moodle_user_delete_users' => array(
3c1aa6fd 442 'classname' => 'moodle_user_external',
5d1017e1
JM
443 'methodname' => 'delete_users',
444 'classpath' => 'user/externallib.php',
3c1aa6fd 445 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_user_delete_users()',
5d1017e1
JM
446 'type' => 'write',
447 'capabilities'=> 'moodle/user:delete',
448 ),
449
450 'core_user_delete_users' => array(
451 'classname' => 'core_user_external',
ef22c1b6 452 'methodname' => 'delete_users',
453 'classpath' => 'user/externallib.php',
fb79269b 454 'description' => 'Delete users.',
455 'type' => 'write',
72f68b51 456 'capabilities'=> 'moodle/user:delete',
ef22c1b6 457 ),
458
459 'moodle_user_update_users' => array(
3c1aa6fd 460 'classname' => 'moodle_user_external',
5d1017e1
JM
461 'methodname' => 'update_users',
462 'classpath' => 'user/externallib.php',
3c1aa6fd 463 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_user_update_users()',
5d1017e1
JM
464 'type' => 'write',
465 'capabilities'=> 'moodle/user:update',
466 ),
467
468 'core_user_update_users' => array(
469 'classname' => 'core_user_external',
ef22c1b6 470 'methodname' => 'update_users',
471 'classpath' => 'user/externallib.php',
fb79269b 472 'description' => 'Update users.',
473 'type' => 'write',
72f68b51 474 'capabilities'=> 'moodle/user:update',
ef22c1b6 475 ),
e9b66095 476
6a403810
JL
477 'core_user_add_user_device' => array(
478 'classname' => 'core_user_external',
479 'methodname' => 'add_user_device',
480 'classpath' => 'user/externallib.php',
481 'description' => 'Store mobile user devices information for PUSH Notifications.',
482 'type' => 'write',
483 'capabilities'=> '',
484 ),
485
3221718e
JL
486 'core_user_remove_user_device' => array(
487 'classname' => 'core_user_external',
488 'methodname' => 'remove_user_device',
489 'classpath' => 'user/externallib.php',
490 'description' => 'Remove a user device from the Moodle database.',
491 'type' => 'write',
492 'capabilities' => '',
493 ),
494
72f68b51 495 // === enrol related functions ===
d0068cd0 496
b6b6c7ac
PC
497 'core_enrol_get_enrolled_users_with_capability' => array(
498 'classname' => 'core_enrol_external',
499 'methodname' => 'get_enrolled_users_with_capability',
500 'classpath' => 'enrol/externallib.php',
501 'description' => 'For each course and capability specified, return a list of the users that are enrolled in the course
502 and have that capability',
503 'type' => 'read',
504 ),
72f68b51 505
df997f84
PS
506 'moodle_enrol_get_enrolled_users' => array(
507 'classname' => 'moodle_enrol_external',
508 'methodname' => 'get_enrolled_users',
509 'classpath' => 'enrol/externallib.php',
5d1017e1 510 '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 511 'type' => 'read',
72f68b51 512 'capabilities'=> 'moodle/site:viewparticipants, moodle/course:viewparticipants,
513 moodle/role:review, moodle/site:accessallgroups, moodle/course:enrolreview',
df997f84 514 ),
e6acc551 515
5d1017e1
JM
516 'core_enrol_get_enrolled_users' => array(
517 'classname' => 'core_enrol_external',
518 'methodname' => 'get_enrolled_users',
519 'classpath' => 'enrol/externallib.php',
520 'description' => 'Get enrolled users by course id.',
521 'type' => 'read',
522 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
523 ),
df997f84 524
3364dbb5 525 'moodle_enrol_get_users_courses' => array(
3c1aa6fd 526 'classname' => 'moodle_enrol_external',
3364dbb5
PS
527 'methodname' => 'get_users_courses',
528 'classpath' => 'enrol/externallib.php',
3c1aa6fd 529 '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
530 'type' => 'read',
531 'capabilities'=> 'moodle/course:viewparticipants',
532 ),
533
5d1017e1
JM
534 'core_enrol_get_users_courses' => array(
535 'classname' => 'core_enrol_external',
536 'methodname' => 'get_users_courses',
537 'classpath' => 'enrol/externallib.php',
538 'description' => 'Get the list of courses where a user is enrolled in',
539 'type' => 'read',
540 'capabilities'=> 'moodle/course:viewparticipants',
541 ),
542
be9bf94e
RT
543 'core_enrol_get_course_enrolment_methods' => array(
544 'classname' => 'core_enrol_external',
545 'methodname' => 'get_course_enrolment_methods',
546 'classpath' => 'enrol/externallib.php',
547 'description' => 'Get the list of course enrolment methods',
548 'type' => 'read',
549 ),
550
5d1017e1
JM
551 // === Role related functions ===
552
df997f84 553 'moodle_role_assign' => array(
3c1aa6fd
DM
554 'classname' => 'moodle_enrol_external',
555 'methodname' => 'role_assign',
5d1017e1 556 'classpath' => 'enrol/externallib.php',
3c1aa6fd 557 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_role_assign_role()',
5d1017e1
JM
558 'type' => 'write',
559 'capabilities'=> 'moodle/role:assign',
560 ),
561
562 'core_role_assign_roles' => array(
563 'classname' => 'core_role_external',
564 'methodname' => 'assign_roles',
e9b66095 565 'classpath' => 'enrol/externallib.php',
df997f84 566 'description' => 'Manual role assignments.',
e9b66095 567 'type' => 'write',
72f68b51 568 'capabilities'=> 'moodle/role:assign',
e9b66095 569 ),
570
df997f84 571 'moodle_role_unassign' => array(
3c1aa6fd
DM
572 'classname' => 'moodle_enrol_external',
573 'methodname' => 'role_unassign',
5d1017e1 574 'classpath' => 'enrol/externallib.php',
3c1aa6fd 575 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_role_unassign_role()',
5d1017e1
JM
576 'type' => 'write',
577 'capabilities'=> 'moodle/role:assign',
578 ),
579
580 'core_role_unassign_roles' => array(
581 'classname' => 'core_role_external',
582 'methodname' => 'unassign_roles',
e9b66095 583 'classpath' => 'enrol/externallib.php',
df997f84 584 'description' => 'Manual role unassignments.',
e9b66095 585 'type' => 'write',
72f68b51 586 'capabilities'=> 'moodle/role:assign',
e9b66095 587 ),
5b4a78e2 588
6bb31e40 589 // === course related functions ===
590
3ec163dd 591 'core_course_get_contents' => array(
d4a246bc 592 'classname' => 'core_course_external',
3ec163dd 593 'methodname' => 'get_course_contents',
d4a246bc 594 'classpath' => 'course/externallib.php',
3ec163dd 595 'description' => 'Get course contents',
d4a246bc 596 'type' => 'read',
3ec163dd 597 'capabilities'=> 'moodle/course:update,moodle/course:viewhiddencourses',
f2229c68 598 ),
d6ebe011 599
6bb31e40 600 'moodle_course_get_courses' => array(
3c1aa6fd 601 'classname' => 'moodle_course_external',
5d1017e1
JM
602 'methodname' => 'get_courses',
603 'classpath' => 'course/externallib.php',
3c1aa6fd 604 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_course_get_courses()',
5d1017e1
JM
605 'type' => 'read',
606 'capabilities'=> 'moodle/course:view,moodle/course:update,moodle/course:viewhiddencourses',
607 ),
608
609 'core_course_get_courses' => array(
610 'classname' => 'core_course_external',
6bb31e40 611 'methodname' => 'get_courses',
612 'classpath' => 'course/externallib.php',
613 'description' => 'Return course details',
614 'type' => 'read',
615 'capabilities'=> 'moodle/course:view,moodle/course:update,moodle/course:viewhiddencourses',
616 ),
617
618 'moodle_course_create_courses' => array(
3c1aa6fd 619 'classname' => 'moodle_course_external',
5d1017e1
JM
620 'methodname' => 'create_courses',
621 'classpath' => 'course/externallib.php',
3c1aa6fd 622 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_course_create_courses()',
5d1017e1
JM
623 'type' => 'write',
624 'capabilities'=> 'moodle/course:create,moodle/course:visibility',
625 ),
626
627 'core_course_create_courses' => array(
628 'classname' => 'core_course_external',
6bb31e40 629 'methodname' => 'create_courses',
630 'classpath' => 'course/externallib.php',
631 'description' => 'Create new courses',
632 'type' => 'write',
633 'capabilities'=> 'moodle/course:create,moodle/course:visibility',
634 ),
635
63a85dc7
JL
636 'core_course_delete_courses' => array(
637 'classname' => 'core_course_external',
638 'methodname' => 'delete_courses',
639 'classpath' => 'course/externallib.php',
640 'description' => 'Deletes all specified courses',
641 'type' => 'write',
642 'capabilities'=> 'moodle/course:delete',
643 ),
644
79949c1b
MN
645 'core_course_delete_modules' => array(
646 'classname' => 'core_course_external',
647 'methodname' => 'delete_modules',
648 'classpath' => 'course/externallib.php',
649 'description' => 'Deletes all specified module instances',
650 'type' => 'write',
651 'capabilities' => 'moodle/course:manageactivities'
652 ),
653
3dc1d76e
JL
654 'core_course_duplicate_course' => array(
655 'classname' => 'core_course_external',
656 'methodname' => 'duplicate_course',
657 'classpath' => 'course/externallib.php',
658 'description' => 'Duplicate an existing course (creating a new one) without user data',
659 'type' => 'write',
660 'capabilities'=> 'moodle/backup:backupcourse,moodle/restore:restorecourse,moodle/course:create',
661 ),
662
791723c3
RT
663 'core_course_update_courses' => array(
664 'classname' => 'core_course_external',
665 'methodname' => 'update_courses',
666 'classpath' => 'course/externallib.php',
667 'description' => 'Update courses',
668 'type' => 'write',
669 'capabilities'=> 'moodle/course:update,moodle/course:changecategory,moodle/course:changefullname,moodle/course:changeshortname,moodle/course:changeidnumber,moodle/course:changesummary,moodle/course:visibility',
670 ),
671
3ec163dd
EL
672 // === course category related functions ===
673
674 'core_course_get_categories' => array(
675 'classname' => 'core_course_external',
676 'methodname' => 'get_categories',
677 'classpath' => 'course/externallib.php',
678 'description' => 'Return category details',
679 'type' => 'read',
680 'capabilities'=> 'moodle/category:viewhiddencategories',
681 ),
682
479a5db1
FS
683 'core_course_create_categories' => array(
684 'classname' => 'core_course_external',
685 'methodname' => 'create_categories',
686 'classpath' => 'course/externallib.php',
687 'description' => 'Create course categories',
688 'type' => 'write',
689 'capabilities'=> 'moodle/category:manage',
690 ),
d6ebe011 691
3ec163dd
EL
692 'core_course_update_categories' => array(
693 'classname' => 'core_course_external',
694 'methodname' => 'update_categories',
695 'classpath' => 'course/externallib.php',
696 'description' => 'Update categories',
697 'type' => 'write',
afe27edc 698 'capabilities'=> 'moodle/category:manage',
3ec163dd
EL
699 ),
700
2f951d86
FS
701 'core_course_delete_categories' => array(
702 'classname' => 'core_course_external',
703 'methodname' => 'delete_categories',
704 'classpath' => 'course/externallib.php',
705 'description' => 'Delete course categories',
706 'type' => 'write',
707 'capabilities'=> 'moodle/category:manage',
708 ),
479a5db1 709
8430d87b
JL
710 'core_course_import_course' => array(
711 'classname' => 'core_course_external',
712 'methodname' => 'import_course',
713 'classpath' => 'course/externallib.php',
714 'description' => 'Import course data from a course into another course. Does not include any user data.',
715 'type' => 'write',
716 'capabilities'=> 'moodle/backup:backuptargetimport, moodle/restore:restoretargetimport',
717 ),
718
a623b6b8
JM
719 // === message related functions ===
720
4de00da7 721 'moodle_message_send_instantmessages' => array(
3c1aa6fd
DM
722 'classname' => 'moodle_message_external',
723 'methodname' => 'send_instantmessages',
5d1017e1 724 'classpath' => 'message/externallib.php',
3c1aa6fd 725 '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
726 'type' => 'write',
727 'capabilities'=> 'moodle/site:sendmessage',
728 ),
729
730 'core_message_send_instant_messages' => array(
731 'classname' => 'core_message_external',
732 'methodname' => 'send_instant_messages',
a623b6b8 733 'classpath' => 'message/externallib.php',
4de00da7 734 'description' => 'Send instant messages',
a623b6b8
JM
735 'type' => 'write',
736 'capabilities'=> 'moodle/site:sendmessage',
737 ),
738
d6731600
FM
739 'core_message_create_contacts' => array(
740 'classname' => 'core_message_external',
741 'methodname' => 'create_contacts',
742 'classpath' => 'message/externallib.php',
743 'description' => 'Add contacts to the contact list',
744 'type' => 'write',
745 'capabilities'=> '',
746 ),
747
748 'core_message_delete_contacts' => array(
749 'classname' => 'core_message_external',
750 'methodname' => 'delete_contacts',
751 'classpath' => 'message/externallib.php',
752 'description' => 'Remove contacts from the contact list',
753 'type' => 'write',
754 'capabilities'=> '',
755 ),
756
757 'core_message_block_contacts' => array(
758 'classname' => 'core_message_external',
759 'methodname' => 'block_contacts',
760 'classpath' => 'message/externallib.php',
761 'description' => 'Block contacts',
762 'type' => 'write',
763 'capabilities'=> '',
764 ),
765
766 'core_message_unblock_contacts' => array(
767 'classname' => 'core_message_external',
768 'methodname' => 'unblock_contacts',
769 'classpath' => 'message/externallib.php',
770 'description' => 'Unblock contacts',
771 'type' => 'write',
772 'capabilities'=> '',
773 ),
774
775 'core_message_get_contacts' => array(
776 'classname' => 'core_message_external',
777 'methodname' => 'get_contacts',
778 'classpath' => 'message/externallib.php',
779 'description' => 'Retrieve the contact list',
780 'type' => 'read',
781 'capabilities'=> '',
782 ),
783
784 'core_message_search_contacts' => array(
785 'classname' => 'core_message_external',
786 'methodname' => 'search_contacts',
787 'classpath' => 'message/externallib.php',
788 'description' => 'Search for contacts',
789 'type' => 'read',
790 'capabilities'=> '',
791 ),
792
aff9da17 793 'core_message_get_messages' => array(
6ff4464b
JL
794 'classname' => 'core_message_external',
795 'methodname' => 'get_messages',
796 'classpath' => 'message/externallib.php',
127ef540 797 'description' => 'Retrieve a list of messages sent and received by a user (conversations, notifications or both)',
6ff4464b
JL
798 'type' => 'read',
799 'capabilities' => '',
aff9da17
JL
800 ),
801
60ab2e1b
JL
802 'core_message_get_blocked_users' => array(
803 'classname' => 'core_message_external',
804 'methodname' => 'get_blocked_users',
805 'classpath' => 'message/externallib.php',
806 'description' => 'Retrieve a list of users blocked',
807 'type' => 'read',
808 'capabilities' => '',
809 ),
810
8d46dabb
JM
811 // === notes related functions ===
812
813 'moodle_notes_create_notes' => array(
3c1aa6fd 814 'classname' => 'moodle_notes_external',
5d1017e1
JM
815 'methodname' => 'create_notes',
816 'classpath' => 'notes/externallib.php',
3c1aa6fd 817 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_notes_create_notes()',
5d1017e1
JM
818 'type' => 'write',
819 'capabilities'=> 'moodle/notes:manage',
820 ),
821
822 'core_notes_create_notes' => array(
823 'classname' => 'core_notes_external',
8d46dabb
JM
824 'methodname' => 'create_notes',
825 'classpath' => 'notes/externallib.php',
826 'description' => 'Create notes',
827 'type' => 'write',
828 'capabilities'=> 'moodle/notes:manage',
829 ),
830
34348b2b
JF
831 'core_notes_delete_notes' => array(
832 'classname' => 'core_notes_external',
833 'methodname' => 'delete_notes',
834 'classpath' => 'notes/externallib.php',
835 'description' => 'Delete notes',
836 'type' => 'write',
837 'capabilities'=> 'moodle/notes:manage',
838 ),
839
840 'core_notes_get_notes' => array(
841 'classname' => 'core_notes_external',
842 'methodname' => 'get_notes',
843 'classpath' => 'notes/externallib.php',
844 'description' => 'Get notes',
845 'type' => 'read',
846 'capabilities'=> 'moodle/notes:view',
847 ),
848
849 'core_notes_update_notes' => array(
850 'classname' => 'core_notes_external',
851 'methodname' => 'update_notes',
852 'classpath' => 'notes/externallib.php',
853 'description' => 'Update notes',
854 'type' => 'write',
855 'capabilities'=> 'moodle/notes:manage',
856 ),
857
9028d9b5
PC
858 // === grading related functions ===
859
860 'core_grading_get_definitions' => array(
861 'classname' => 'core_grading_external',
862 'methodname' => 'get_definitions',
9028d9b5
PC
863 'description' => 'Get grading definitions',
864 'type' => 'read'
865 ),
3f0ea6d8
PC
866
867 'core_grade_get_definitions' => array(
868 'classname' => 'core_grade_external',
869 'methodname' => 'get_definitions',
870 'classpath' => 'grade/externallib.php',
9028d9b5
PC
871 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_grading_get_definitions()',
872 'type' => 'read'
873 ),
874
0ff4ebb4
PC
875 'core_grading_save_definitions' => array(
876 'classname' => 'core_grading_external',
877 'methodname' => 'save_definitions',
878 'description' => 'Save grading definitions',
879 'type' => 'write'
880 ),
881
9028d9b5
PC
882 'core_grading_get_gradingform_instances' => array(
883 'classname' => 'core_grading_external',
884 'methodname' => 'get_gradingform_instances',
9028d9b5 885 'description' => 'Get grading form instances',
3f0ea6d8
PC
886 'type' => 'read'
887 ),
888
0bf486a6
JM
889 // === webservice related functions ===
890
891 'moodle_webservice_get_siteinfo' => array(
3c1aa6fd
DM
892 'classname' => 'moodle_webservice_external',
893 'methodname' => 'get_siteinfo',
5d1017e1 894 'classpath' => 'webservice/externallib.php',
3c1aa6fd 895 '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
896 'type' => 'read',
897 ),
898
899 'core_webservice_get_site_info' => array(
900 'classname' => 'core_webservice_external',
901 'methodname' => 'get_site_info',
0bf486a6
JM
902 'classpath' => 'webservice/externallib.php',
903 'description' => 'Return some site info / user info / list web service functions',
904 'type' => 'read',
905 ),
906
11e76602
JM
907 'core_get_string' => array(
908 'classname' => 'core_external',
909 'methodname' => 'get_string',
910 'classpath' => 'lib/external/externallib.php',
911 'description' => 'Return a translated string - similar to core get_string() call',
912 'type' => 'read',
913 ),
914
915 'core_get_strings' => array(
916 'classname' => 'core_external',
917 'methodname' => 'get_strings',
918 'classpath' => 'lib/external/externallib.php',
919 'description' => 'Return some translated strings - like several core get_string() calls',
920 'type' => 'read',
921 ),
922
923 'core_get_component_strings' => array(
924 'classname' => 'core_external',
925 'methodname' => 'get_component_strings',
926 'classpath' => 'lib/external/externallib.php',
927 'description' => 'Return all raw strings (with {$a->xxx}) for a specific component
928 - similar to core get_component_strings() call',
929 'type' => 'read',
930 ),
5e1350ab
AA
931
932
933 // === Calendar related functions ===
934
935 'core_calendar_delete_calendar_events' => array(
936 'classname' => 'core_calendar_external',
937 'methodname' => 'delete_calendar_events',
938 'description' => 'Delete calendar events',
939 'classpath' => 'calendar/externallib.php',
940 'type' => 'write',
941 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
942 ),
943
793d3855
AA
944
945 'core_calendar_get_calendar_events' => array(
946 'classname' => 'core_calendar_external',
947 'methodname' => 'get_calendar_events',
948 'description' => 'Get calendar events',
949 'classpath' => 'calendar/externallib.php',
950 'type' => 'read',
951 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
952 ),
953
c66dc3df
AA
954 'core_calendar_create_calendar_events' => array(
955 'classname' => 'core_calendar_external',
956 'methodname' => 'create_calendar_events',
957 'description' => 'Create calendar events',
958 'classpath' => 'calendar/externallib.php',
959 'type' => 'write',
960 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
961 ),
9bdcf579
DW
962
963 'core_output_load_template' => array(
964 'classname' => 'core\output\external',
965 'methodname' => 'load_template',
966 'description' => 'Load a template for a renderable',
967 'type' => 'read'
968 ),
25c49a85
JL
969
970 // Completion related functions.
971 'core_completion_update_activity_completion_status_manually' => array(
972 'classname' => 'core_completion_external',
973 'methodname' => 'update_activity_completion_status_manually',
974 'description' => 'Update completion status for the current user in an activity, only for activities with manual tracking.',
975 'type' => 'write',
976 ),
9a0df45a 977);
c1b65883
JM
978
979$services = array(
96e0194c
SH
980 'Moodle mobile web service' => array(
981 'functions' => array (
982 'moodle_enrol_get_users_courses',
983 'moodle_enrol_get_enrolled_users',
f2806b9a
JM
984 'moodle_user_get_users_by_id',
985 'moodle_webservice_get_siteinfo',
986 'moodle_notes_create_notes',
ea4e96c2 987 'moodle_user_get_course_participants_by_id',
01479290 988 'moodle_user_get_users_by_courseid',
ec0d6ea2 989 'moodle_message_send_instantmessages',
11e76602 990 'core_course_get_contents',
6a403810 991 'core_get_component_strings',
925f4d6b 992 'core_user_add_user_device',
cb9d8257
JL
993 'core_calendar_get_calendar_events',
994 'core_enrol_get_users_courses',
995 'core_enrol_get_enrolled_users',
996 'core_user_get_users_by_id',
997 'core_webservice_get_site_info',
998 'core_notes_create_notes',
999 'core_user_get_course_user_profiles',
ba1dc597
JL
1000 'core_message_send_instant_messages',
1001 'mod_assign_get_grades',
1002 'mod_assign_get_assignments',
1003 'mod_assign_get_submissions',
1004 'mod_assign_get_user_flags',
1005 'mod_assign_set_user_flags',
1006 'mod_assign_get_user_mappings',
1007 'mod_assign_revert_submissions_to_draft',
1008 'mod_assign_lock_submissions',
1009 'mod_assign_unlock_submissions',
1010 'mod_assign_save_submission',
1011 'mod_assign_submit_for_grading',
1012 'mod_assign_save_grade',
1013 'mod_assign_save_user_extensions',
6acfacfa
JL
1014 'mod_assign_reveal_identities',
1015 'message_airnotifier_is_system_configured',
2e04d250 1016 'message_airnotifier_are_notification_preferences_configured',
e2ede426
JL
1017 'core_grades_update_grades',
1018 'mod_forum_get_forums_by_courses',
2ce8934b 1019 'mod_forum_get_forum_discussions_paginated',
feae0f9f 1020 'mod_forum_get_forum_discussion_posts',
aff9da17 1021 'core_files_get_files',
93872873
JL
1022 'core_message_get_messages',
1023 'core_message_create_contacts',
1024 'core_message_delete_contacts',
1025 'core_message_block_contacts',
1026 'core_message_unblock_contacts',
1027 'core_message_get_contacts',
60ab2e1b 1028 'core_message_search_contacts',
3a2ba746 1029 'core_message_get_blocked_users',
5d62e813 1030 'gradereport_user_get_grades_table',
db23cd08
AN
1031 'core_group_get_course_user_groups',
1032 'core_user_remove_user_device',
25c49a85
JL
1033 'core_course_get_courses',
1034 'core_completion_update_activity_completion_status_manually',
6f27fbb4 1035 'mod_data_get_databases_by_courses'
60ab2e1b 1036 ),
96e0194c
SH
1037 'enabled' => 0,
1038 'restrictedusers' => 0,
af03513f 1039 'shortname' => MOODLE_OFFICIAL_MOBILE_SERVICE,
106c55fb
DW
1040 'downloadfiles' => 1,
1041 'uploadfiles' => 1
96e0194c
SH
1042 ),
1043);