Merge branch 'MDL-44480-master' of git://github.com/andrewnicols/moodle
[moodle.git] / lib / db / services.php
CommitLineData
9a0df45a 1<?php
9a0df45a 2// This file is part of Moodle - http://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16
a0a07014 17
9a0df45a 18/**
19 * Core external functions and service definitions.
20 *
39b90b51
EL
21 * The functions and services defined on this file are
22 * processed and registered into the Moodle DB after any
23 * install or upgrade operation. All plugins support this.
24 *
25 * For more information, take a look to the documentation available:
26 * - Webservices API: {@link http://docs.moodle.org/dev/Web_services_API}
27 * - External API: {@link http://docs.moodle.org/dev/External_functions_API}
28 * - Upgrade API: {@link http://docs.moodle.org/dev/Upgrade_API}
29 *
a0a07014
JM
30 * @package core_webservice
31 * @category webservice
32 * @copyright 2009 Petr Skodak
9a0df45a 33 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
34 */
35
36$functions = array(
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 ),
102
ef22c1b6 103 // === group related functions ===
f5072177 104
9a0df45a 105 'moodle_group_create_groups' => array(
5d1017e1
JM
106 'classname' => 'core_group_external',
107 'methodname' => 'create_groups',
108 'classpath' => 'group/externallib.php',
109 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_group_create_groups(). ',
110 'type' => 'write',
111 'capabilities'=> 'moodle/course:managegroups',
112 ),
113
114 'core_group_create_groups' => array(
115 'classname' => 'core_group_external',
9a0df45a 116 'methodname' => 'create_groups',
117 'classpath' => 'group/externallib.php',
f5072177 118 'description' => 'Creates new groups.',
119 'type' => 'write',
72f68b51 120 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 121 ),
f5072177 122
9a0df45a 123 'moodle_group_get_groups' => array(
5d1017e1
JM
124 'classname' => 'core_group_external',
125 'methodname' => 'get_groups',
126 'classpath' => 'group/externallib.php',
127 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_group_get_groups()',
128 'type' => 'read',
129 'capabilities'=> 'moodle/course:managegroups',
130 ),
131
132 'core_group_get_groups' => array(
133 'classname' => 'core_group_external',
9a0df45a 134 'methodname' => 'get_groups',
135 'classpath' => 'group/externallib.php',
cfb99b75 136 'description' => 'Returns group details.',
f5072177 137 'type' => 'read',
72f68b51 138 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 139 ),
246f6da2 140
141 'moodle_group_get_course_groups' => array(
5d1017e1
JM
142 'classname' => 'core_group_external',
143 'methodname' => 'get_course_groups',
144 'classpath' => 'group/externallib.php',
145 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_group_get_course_groups()',
146 'type' => 'read',
147 'capabilities'=> 'moodle/course:managegroups',
148 ),
149
150 'core_group_get_course_groups' => array(
151 'classname' => 'core_group_external',
246f6da2 152 'methodname' => 'get_course_groups',
153 'classpath' => 'group/externallib.php',
154 'description' => 'Returns all groups in specified course.',
155 'type' => 'read',
72f68b51 156 'capabilities'=> 'moodle/course:managegroups',
246f6da2 157 ),
2cb1ee78 158
9a0df45a 159 'moodle_group_delete_groups' => array(
5d1017e1
JM
160 'classname' => 'core_group_external',
161 'methodname' => 'delete_groups',
162 'classpath' => 'group/externallib.php',
163 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_group_delete_groups()',
164 'type' => 'delete',
165 'capabilities'=> 'moodle/course:managegroups',
166 ),
167
168 'core_group_delete_groups' => array(
169 'classname' => 'core_group_external',
9a0df45a 170 'methodname' => 'delete_groups',
171 'classpath' => 'group/externallib.php',
0f4e72de
PS
172 'description' => 'Deletes all specified groups.',
173 'type' => 'delete',
72f68b51 174 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 175 ),
c863dc38 176
9a0df45a 177 'moodle_group_get_groupmembers' => array(
5d1017e1
JM
178 'classname' => 'core_group_external',
179 'methodname' => 'get_group_members',
180 'classpath' => 'group/externallib.php',
181 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_group_get_group_members()',
182 'type' => 'read',
183 'capabilities'=> 'moodle/course:managegroups',
184 ),
185
186 'core_group_get_group_members' => array(
187 'classname' => 'core_group_external',
188 'methodname' => 'get_group_members',
9a0df45a 189 'classpath' => 'group/externallib.php',
0f4e72de
PS
190 'description' => 'Returns group members.',
191 'type' => 'read',
72f68b51 192 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 193 ),
4efa2483 194
9a0df45a 195 'moodle_group_add_groupmembers' => array(
5d1017e1
JM
196 'classname' => 'core_group_external',
197 'methodname' => 'add_group_members',
198 'classpath' => 'group/externallib.php',
199 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_group_add_group_members()',
200 'type' => 'write',
201 'capabilities'=> 'moodle/course:managegroups',
202 ),
203
204 'core_group_add_group_members' => array(
205 'classname' => 'core_group_external',
206 'methodname' => 'add_group_members',
9a0df45a 207 'classpath' => 'group/externallib.php',
0f4e72de
PS
208 'description' => 'Adds group members.',
209 'type' => 'write',
72f68b51 210 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 211 ),
212
213 'moodle_group_delete_groupmembers' => array(
5d1017e1
JM
214 'classname' => 'core_group_external',
215 'methodname' => 'delete_group_members',
9a0df45a 216 'classpath' => 'group/externallib.php',
5d1017e1 217 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_group_delete_group_members()',
0f4e72de 218 'type' => 'delete',
72f68b51 219 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 220 ),
72f68b51 221
5d1017e1
JM
222 'core_group_delete_group_members' => array(
223 'classname' => 'core_group_external',
224 'methodname' => 'delete_group_members',
225 'classpath' => 'group/externallib.php',
226 'description' => 'Deletes group members.',
227 'type' => 'delete',
228 'capabilities'=> 'moodle/course:managegroups',
229 ),
72f68b51 230
7ce23590
JL
231 'core_group_create_groupings' => array(
232 'classname' => 'core_group_external',
233 'methodname' => 'create_groupings',
234 'classpath' => 'group/externallib.php',
235 'description' => 'Creates new groupings',
236 'type' => 'write',
237 ),
238
239 'core_group_update_groupings' => array(
240 'classname' => 'core_group_external',
241 'methodname' => 'update_groupings',
242 'classpath' => 'group/externallib.php',
243 'description' => 'Updates existing groupings',
244 'type' => 'write',
245 ),
246
247 'core_group_get_groupings' => array(
248 'classname' => 'core_group_external',
249 'methodname' => 'get_groupings',
250 'classpath' => 'group/externallib.php',
251 'description' => 'Returns groupings details.',
252 'type' => 'read',
253 ),
254
255 'core_group_get_course_groupings' => array(
67aa60f9
JL
256 'classname' => 'core_group_external',
257 'methodname' => 'get_course_groupings',
258 'classpath' => 'group/externallib.php',
259 'description' => 'Returns all groupings in specified course.',
260 'type' => 'read',
7ce23590
JL
261 ),
262
263 'core_group_delete_groupings' => array(
67aa60f9
JL
264 'classname' => 'core_group_external',
265 'methodname' => 'delete_groupings',
266 'classpath' => 'group/externallib.php',
267 'description' => 'Deletes all specified groupings.',
268 'type' => 'write',
7ce23590
JL
269 ),
270
271 'core_group_assign_grouping' => array(
67aa60f9
JL
272 'classname' => 'core_group_external',
273 'methodname' => 'assign_grouping',
274 'classpath' => 'group/externallib.php',
275 'description' => 'Assing groups from groupings',
276 'type' => 'write',
7ce23590
JL
277 ),
278
279 'core_group_unassign_grouping' => array(
67aa60f9
JL
280 'classname' => 'core_group_external',
281 'methodname' => 'unassign_grouping',
282 'classpath' => 'group/externallib.php',
283 'description' => 'Unassing groups from groupings',
284 'type' => 'write',
7ce23590
JL
285 ),
286
72f68b51 287 // === file related functions ===
288
249c4f60 289 'moodle_file_get_files' => array(
5d1017e1
JM
290 'classname' => 'core_files_external',
291 'methodname' => 'get_files',
292 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_files_get_files()',
293 'type' => 'read',
294 'classpath' => 'files/externallib.php',
295 ),
296
297 'core_files_get_files' => array(
298 'classname' => 'core_files_external',
249c4f60
DC
299 'methodname' => 'get_files',
300 'description' => 'browse moodle files',
301 'type' => 'read',
302 'classpath' => 'files/externallib.php',
303 ),
5d1017e1 304
249c4f60 305 'moodle_file_upload' => array(
5d1017e1
JM
306 'classname' => 'core_files_external',
307 'methodname' => 'upload',
308 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_files_upload()',
309 'type' => 'write',
310 'classpath' => 'files/externallib.php',
311 ),
312
313 'core_files_upload' => array(
314 'classname' => 'core_files_external',
249c4f60
DC
315 'methodname' => 'upload',
316 'description' => 'upload a file to moodle',
317 'type' => 'write',
318 'classpath' => 'files/externallib.php',
319 ),
4efa2483 320
ef22c1b6 321 // === user related functions ===
72f68b51 322
ef22c1b6 323 'moodle_user_create_users' => array(
5d1017e1
JM
324 'classname' => 'core_user_external',
325 'methodname' => 'create_users',
326 'classpath' => 'user/externallib.php',
327 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_user_create_users()',
328 'type' => 'write',
329 'capabilities'=> 'moodle/user:create',
330 ),
331
332 'core_user_create_users' => array(
333 'classname' => 'core_user_external',
ef22c1b6 334 'methodname' => 'create_users',
335 'classpath' => 'user/externallib.php',
fb79269b 336 'description' => 'Create users.',
337 'type' => 'write',
72f68b51 338 'capabilities'=> 'moodle/user:create',
ef22c1b6 339 ),
340
b0365ea5
JM
341 'core_user_get_users' => array(
342 'classname' => 'core_user_external',
343 'methodname' => 'get_users',
344 'classpath' => 'user/externallib.php',
345 'description' => 'search for users matching the parameters',
346 'type' => 'read',
347 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
348 ),
349
fb79269b 350 'moodle_user_get_users_by_id' => array(
5d1017e1
JM
351 'classname' => 'core_user_external',
352 'methodname' => 'get_users_by_id',
353 'classpath' => 'user/externallib.php',
354 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_user_get_users_by_id()',
355 'type' => 'read',
356 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
357 ),
358
c70b9853 359 'core_user_get_users_by_field' => array(
86477112 360 'classname' => 'core_user_external',
c70b9853 361 'methodname' => 'get_users_by_field',
86477112 362 'classpath' => 'user/externallib.php',
c70b9853 363 'description' => 'Retrieve users information for a specified unique field - If you want to do a user search, use core_user_get_users()',
86477112
FS
364 'type' => 'read',
365 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
366 ),
367
5d1017e1
JM
368 'core_user_get_users_by_id' => array(
369 'classname' => 'core_user_external',
fb79269b 370 'methodname' => 'get_users_by_id',
ef22c1b6 371 'classpath' => 'user/externallib.php',
41f5285f 372 '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 373 'type' => 'read',
b4c74367 374 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
ef22c1b6 375 ),
376
01479290 377 'moodle_user_get_users_by_courseid' => array(
5d1017e1
JM
378 'classname' => 'core_enrol_external',
379 'methodname' => 'get_enrolled_users',
380 'classpath' => 'enrol/externallib.php',
381 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_enrol_get_enrolled_users()',
01479290
DC
382 'type' => 'read',
383 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
384 ),
385
ea4e96c2 386 'moodle_user_get_course_participants_by_id' => array(
5d1017e1
JM
387 'classname' => 'core_user_external',
388 'methodname' => 'get_course_user_profiles',
ea4e96c2 389 'classpath' => 'user/externallib.php',
5d1017e1
JM
390 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_user_get_course_user_profiles()',
391 'type' => 'read',
392 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
393 ),
394
395 'core_user_get_course_user_profiles' => array(
396 'classname' => 'core_user_external',
397 'methodname' => 'get_course_user_profiles',
398 'classpath' => 'user/externallib.php',
399 'description' => 'Get course user profiles (each of the profils matching a course id and a user id).',
ea4e96c2
DC
400 'type' => 'read',
401 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
402 ),
403
ef22c1b6 404 'moodle_user_delete_users' => array(
5d1017e1
JM
405 'classname' => 'core_user_external',
406 'methodname' => 'delete_users',
407 'classpath' => 'user/externallib.php',
408 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_user_delete_users()',
409 'type' => 'write',
410 'capabilities'=> 'moodle/user:delete',
411 ),
412
413 'core_user_delete_users' => array(
414 'classname' => 'core_user_external',
ef22c1b6 415 'methodname' => 'delete_users',
416 'classpath' => 'user/externallib.php',
fb79269b 417 'description' => 'Delete users.',
418 'type' => 'write',
72f68b51 419 'capabilities'=> 'moodle/user:delete',
ef22c1b6 420 ),
421
422 'moodle_user_update_users' => array(
5d1017e1
JM
423 'classname' => 'core_user_external',
424 'methodname' => 'update_users',
425 'classpath' => 'user/externallib.php',
426 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_user_update_users()',
427 'type' => 'write',
428 'capabilities'=> 'moodle/user:update',
429 ),
430
431 'core_user_update_users' => array(
432 'classname' => 'core_user_external',
ef22c1b6 433 'methodname' => 'update_users',
434 'classpath' => 'user/externallib.php',
fb79269b 435 'description' => 'Update users.',
436 'type' => 'write',
72f68b51 437 'capabilities'=> 'moodle/user:update',
ef22c1b6 438 ),
e9b66095 439
6a403810
JL
440 'core_user_add_user_device' => array(
441 'classname' => 'core_user_external',
442 'methodname' => 'add_user_device',
443 'classpath' => 'user/externallib.php',
444 'description' => 'Store mobile user devices information for PUSH Notifications.',
445 'type' => 'write',
446 'capabilities'=> '',
447 ),
448
72f68b51 449 // === enrol related functions ===
d0068cd0 450
b6b6c7ac
PC
451 'core_enrol_get_enrolled_users_with_capability' => array(
452 'classname' => 'core_enrol_external',
453 'methodname' => 'get_enrolled_users_with_capability',
454 'classpath' => 'enrol/externallib.php',
455 'description' => 'For each course and capability specified, return a list of the users that are enrolled in the course
456 and have that capability',
457 'type' => 'read',
458 ),
72f68b51 459
df997f84
PS
460 'moodle_enrol_get_enrolled_users' => array(
461 'classname' => 'moodle_enrol_external',
462 'methodname' => 'get_enrolled_users',
463 'classpath' => 'enrol/externallib.php',
5d1017e1 464 '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 465 'type' => 'read',
72f68b51 466 'capabilities'=> 'moodle/site:viewparticipants, moodle/course:viewparticipants,
467 moodle/role:review, moodle/site:accessallgroups, moodle/course:enrolreview',
df997f84 468 ),
e6acc551 469
5d1017e1
JM
470 'core_enrol_get_enrolled_users' => array(
471 'classname' => 'core_enrol_external',
472 'methodname' => 'get_enrolled_users',
473 'classpath' => 'enrol/externallib.php',
474 'description' => 'Get enrolled users by course id.',
475 'type' => 'read',
476 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
477 ),
df997f84 478
3364dbb5 479 'moodle_enrol_get_users_courses' => array(
5d1017e1 480 'classname' => 'core_enrol_external',
3364dbb5
PS
481 'methodname' => 'get_users_courses',
482 'classpath' => 'enrol/externallib.php',
5d1017e1 483 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_enrol_get_users_courses()',
3364dbb5
PS
484 'type' => 'read',
485 'capabilities'=> 'moodle/course:viewparticipants',
486 ),
487
5d1017e1
JM
488 'core_enrol_get_users_courses' => array(
489 'classname' => 'core_enrol_external',
490 'methodname' => 'get_users_courses',
491 'classpath' => 'enrol/externallib.php',
492 'description' => 'Get the list of courses where a user is enrolled in',
493 'type' => 'read',
494 'capabilities'=> 'moodle/course:viewparticipants',
495 ),
496
be9bf94e
RT
497 'core_enrol_get_course_enrolment_methods' => array(
498 'classname' => 'core_enrol_external',
499 'methodname' => 'get_course_enrolment_methods',
500 'classpath' => 'enrol/externallib.php',
501 'description' => 'Get the list of course enrolment methods',
502 'type' => 'read',
503 ),
504
5d1017e1
JM
505 // === Role related functions ===
506
df997f84 507 'moodle_role_assign' => array(
5d1017e1
JM
508 'classname' => 'core_role_external',
509 'methodname' => 'assign_roles',
510 'classpath' => 'enrol/externallib.php',
511 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_role_assign_role()',
512 'type' => 'write',
513 'capabilities'=> 'moodle/role:assign',
514 ),
515
516 'core_role_assign_roles' => array(
517 'classname' => 'core_role_external',
518 'methodname' => 'assign_roles',
e9b66095 519 'classpath' => 'enrol/externallib.php',
df997f84 520 'description' => 'Manual role assignments.',
e9b66095 521 'type' => 'write',
72f68b51 522 'capabilities'=> 'moodle/role:assign',
e9b66095 523 ),
524
df997f84 525 'moodle_role_unassign' => array(
5d1017e1
JM
526 'classname' => 'core_role_external',
527 'methodname' => 'unassign_roles',
528 'classpath' => 'enrol/externallib.php',
529 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_role_unassign_role()',
530 'type' => 'write',
531 'capabilities'=> 'moodle/role:assign',
532 ),
533
534 'core_role_unassign_roles' => array(
535 'classname' => 'core_role_external',
536 'methodname' => 'unassign_roles',
e9b66095 537 'classpath' => 'enrol/externallib.php',
df997f84 538 'description' => 'Manual role unassignments.',
e9b66095 539 'type' => 'write',
72f68b51 540 'capabilities'=> 'moodle/role:assign',
e9b66095 541 ),
5b4a78e2 542
6bb31e40 543 // === course related functions ===
544
3ec163dd 545 'core_course_get_contents' => array(
d4a246bc 546 'classname' => 'core_course_external',
3ec163dd 547 'methodname' => 'get_course_contents',
d4a246bc 548 'classpath' => 'course/externallib.php',
3ec163dd 549 'description' => 'Get course contents',
d4a246bc 550 'type' => 'read',
3ec163dd 551 'capabilities'=> 'moodle/course:update,moodle/course:viewhiddencourses',
f2229c68 552 ),
d6ebe011 553
6bb31e40 554 'moodle_course_get_courses' => array(
5d1017e1
JM
555 'classname' => 'core_course_external',
556 'methodname' => 'get_courses',
557 'classpath' => 'course/externallib.php',
558 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_course_get_courses()',
559 'type' => 'read',
560 'capabilities'=> 'moodle/course:view,moodle/course:update,moodle/course:viewhiddencourses',
561 ),
562
563 'core_course_get_courses' => array(
564 'classname' => 'core_course_external',
6bb31e40 565 'methodname' => 'get_courses',
566 'classpath' => 'course/externallib.php',
567 'description' => 'Return course details',
568 'type' => 'read',
569 'capabilities'=> 'moodle/course:view,moodle/course:update,moodle/course:viewhiddencourses',
570 ),
571
572 'moodle_course_create_courses' => array(
5d1017e1
JM
573 'classname' => 'core_course_external',
574 'methodname' => 'create_courses',
575 'classpath' => 'course/externallib.php',
576 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_course_create_courses()',
577 'type' => 'write',
578 'capabilities'=> 'moodle/course:create,moodle/course:visibility',
579 ),
580
581 'core_course_create_courses' => array(
582 'classname' => 'core_course_external',
6bb31e40 583 'methodname' => 'create_courses',
584 'classpath' => 'course/externallib.php',
585 'description' => 'Create new courses',
586 'type' => 'write',
587 'capabilities'=> 'moodle/course:create,moodle/course:visibility',
588 ),
589
63a85dc7
JL
590 'core_course_delete_courses' => array(
591 'classname' => 'core_course_external',
592 'methodname' => 'delete_courses',
593 'classpath' => 'course/externallib.php',
594 'description' => 'Deletes all specified courses',
595 'type' => 'write',
596 'capabilities'=> 'moodle/course:delete',
597 ),
598
79949c1b
MN
599 'core_course_delete_modules' => array(
600 'classname' => 'core_course_external',
601 'methodname' => 'delete_modules',
602 'classpath' => 'course/externallib.php',
603 'description' => 'Deletes all specified module instances',
604 'type' => 'write',
605 'capabilities' => 'moodle/course:manageactivities'
606 ),
607
3dc1d76e
JL
608 'core_course_duplicate_course' => array(
609 'classname' => 'core_course_external',
610 'methodname' => 'duplicate_course',
611 'classpath' => 'course/externallib.php',
612 'description' => 'Duplicate an existing course (creating a new one) without user data',
613 'type' => 'write',
614 'capabilities'=> 'moodle/backup:backupcourse,moodle/restore:restorecourse,moodle/course:create',
615 ),
616
791723c3
RT
617 'core_course_update_courses' => array(
618 'classname' => 'core_course_external',
619 'methodname' => 'update_courses',
620 'classpath' => 'course/externallib.php',
621 'description' => 'Update courses',
622 'type' => 'write',
623 'capabilities'=> 'moodle/course:update,moodle/course:changecategory,moodle/course:changefullname,moodle/course:changeshortname,moodle/course:changeidnumber,moodle/course:changesummary,moodle/course:visibility',
624 ),
625
3ec163dd
EL
626 // === course category related functions ===
627
628 'core_course_get_categories' => array(
629 'classname' => 'core_course_external',
630 'methodname' => 'get_categories',
631 'classpath' => 'course/externallib.php',
632 'description' => 'Return category details',
633 'type' => 'read',
634 'capabilities'=> 'moodle/category:viewhiddencategories',
635 ),
636
479a5db1
FS
637 'core_course_create_categories' => array(
638 'classname' => 'core_course_external',
639 'methodname' => 'create_categories',
640 'classpath' => 'course/externallib.php',
641 'description' => 'Create course categories',
642 'type' => 'write',
643 'capabilities'=> 'moodle/category:manage',
644 ),
d6ebe011 645
3ec163dd
EL
646 'core_course_update_categories' => array(
647 'classname' => 'core_course_external',
648 'methodname' => 'update_categories',
649 'classpath' => 'course/externallib.php',
650 'description' => 'Update categories',
651 'type' => 'write',
afe27edc 652 'capabilities'=> 'moodle/category:manage',
3ec163dd
EL
653 ),
654
2f951d86
FS
655 'core_course_delete_categories' => array(
656 'classname' => 'core_course_external',
657 'methodname' => 'delete_categories',
658 'classpath' => 'course/externallib.php',
659 'description' => 'Delete course categories',
660 'type' => 'write',
661 'capabilities'=> 'moodle/category:manage',
662 ),
479a5db1 663
8430d87b
JL
664 'core_course_import_course' => array(
665 'classname' => 'core_course_external',
666 'methodname' => 'import_course',
667 'classpath' => 'course/externallib.php',
668 'description' => 'Import course data from a course into another course. Does not include any user data.',
669 'type' => 'write',
670 'capabilities'=> 'moodle/backup:backuptargetimport, moodle/restore:restoretargetimport',
671 ),
672
a623b6b8
JM
673 // === message related functions ===
674
4de00da7 675 'moodle_message_send_instantmessages' => array(
5d1017e1
JM
676 'classname' => 'core_message_external',
677 'methodname' => 'send_instant_messages',
678 'classpath' => 'message/externallib.php',
679 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_message_send_instant_messages()',
680 'type' => 'write',
681 'capabilities'=> 'moodle/site:sendmessage',
682 ),
683
684 'core_message_send_instant_messages' => array(
685 'classname' => 'core_message_external',
686 'methodname' => 'send_instant_messages',
a623b6b8 687 'classpath' => 'message/externallib.php',
4de00da7 688 'description' => 'Send instant messages',
a623b6b8
JM
689 'type' => 'write',
690 'capabilities'=> 'moodle/site:sendmessage',
691 ),
692
d6731600
FM
693 'core_message_create_contacts' => array(
694 'classname' => 'core_message_external',
695 'methodname' => 'create_contacts',
696 'classpath' => 'message/externallib.php',
697 'description' => 'Add contacts to the contact list',
698 'type' => 'write',
699 'capabilities'=> '',
700 ),
701
702 'core_message_delete_contacts' => array(
703 'classname' => 'core_message_external',
704 'methodname' => 'delete_contacts',
705 'classpath' => 'message/externallib.php',
706 'description' => 'Remove contacts from the contact list',
707 'type' => 'write',
708 'capabilities'=> '',
709 ),
710
711 'core_message_block_contacts' => array(
712 'classname' => 'core_message_external',
713 'methodname' => 'block_contacts',
714 'classpath' => 'message/externallib.php',
715 'description' => 'Block contacts',
716 'type' => 'write',
717 'capabilities'=> '',
718 ),
719
720 'core_message_unblock_contacts' => array(
721 'classname' => 'core_message_external',
722 'methodname' => 'unblock_contacts',
723 'classpath' => 'message/externallib.php',
724 'description' => 'Unblock contacts',
725 'type' => 'write',
726 'capabilities'=> '',
727 ),
728
729 'core_message_get_contacts' => array(
730 'classname' => 'core_message_external',
731 'methodname' => 'get_contacts',
732 'classpath' => 'message/externallib.php',
733 'description' => 'Retrieve the contact list',
734 'type' => 'read',
735 'capabilities'=> '',
736 ),
737
738 'core_message_search_contacts' => array(
739 'classname' => 'core_message_external',
740 'methodname' => 'search_contacts',
741 'classpath' => 'message/externallib.php',
742 'description' => 'Search for contacts',
743 'type' => 'read',
744 'capabilities'=> '',
745 ),
746
8d46dabb
JM
747 // === notes related functions ===
748
749 'moodle_notes_create_notes' => array(
5d1017e1
JM
750 'classname' => 'core_notes_external',
751 'methodname' => 'create_notes',
752 'classpath' => 'notes/externallib.php',
753 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_notes_create_notes()',
754 'type' => 'write',
755 'capabilities'=> 'moodle/notes:manage',
756 ),
757
758 'core_notes_create_notes' => array(
759 'classname' => 'core_notes_external',
8d46dabb
JM
760 'methodname' => 'create_notes',
761 'classpath' => 'notes/externallib.php',
762 'description' => 'Create notes',
763 'type' => 'write',
764 'capabilities'=> 'moodle/notes:manage',
765 ),
766
34348b2b
JF
767 'core_notes_delete_notes' => array(
768 'classname' => 'core_notes_external',
769 'methodname' => 'delete_notes',
770 'classpath' => 'notes/externallib.php',
771 'description' => 'Delete notes',
772 'type' => 'write',
773 'capabilities'=> 'moodle/notes:manage',
774 ),
775
776 'core_notes_get_notes' => array(
777 'classname' => 'core_notes_external',
778 'methodname' => 'get_notes',
779 'classpath' => 'notes/externallib.php',
780 'description' => 'Get notes',
781 'type' => 'read',
782 'capabilities'=> 'moodle/notes:view',
783 ),
784
785 'core_notes_update_notes' => array(
786 'classname' => 'core_notes_external',
787 'methodname' => 'update_notes',
788 'classpath' => 'notes/externallib.php',
789 'description' => 'Update notes',
790 'type' => 'write',
791 'capabilities'=> 'moodle/notes:manage',
792 ),
793
9028d9b5
PC
794 // === grading related functions ===
795
796 'core_grading_get_definitions' => array(
797 'classname' => 'core_grading_external',
798 'methodname' => 'get_definitions',
799 'classpath' => 'grade/externallib.php',
800 'description' => 'Get grading definitions',
801 'type' => 'read'
802 ),
3f0ea6d8
PC
803
804 'core_grade_get_definitions' => array(
805 'classname' => 'core_grade_external',
806 'methodname' => 'get_definitions',
807 'classpath' => 'grade/externallib.php',
9028d9b5
PC
808 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_grading_get_definitions()',
809 'type' => 'read'
810 ),
811
812 'core_grading_get_gradingform_instances' => array(
813 'classname' => 'core_grading_external',
814 'methodname' => 'get_gradingform_instances',
815 'classpath' => 'grade/externallib.php',
816 'description' => 'Get grading form instances',
3f0ea6d8
PC
817 'type' => 'read'
818 ),
819
0bf486a6
JM
820 // === webservice related functions ===
821
822 'moodle_webservice_get_siteinfo' => array(
5d1017e1
JM
823 'classname' => 'core_webservice_external',
824 'methodname' => 'get_site_info',
825 'classpath' => 'webservice/externallib.php',
826 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_webservice_get_site_info()',
827 'type' => 'read',
828 ),
829
830 'core_webservice_get_site_info' => array(
831 'classname' => 'core_webservice_external',
832 'methodname' => 'get_site_info',
0bf486a6
JM
833 'classpath' => 'webservice/externallib.php',
834 'description' => 'Return some site info / user info / list web service functions',
835 'type' => 'read',
836 ),
837
11e76602
JM
838 'core_get_string' => array(
839 'classname' => 'core_external',
840 'methodname' => 'get_string',
841 'classpath' => 'lib/external/externallib.php',
842 'description' => 'Return a translated string - similar to core get_string() call',
843 'type' => 'read',
844 ),
845
846 'core_get_strings' => array(
847 'classname' => 'core_external',
848 'methodname' => 'get_strings',
849 'classpath' => 'lib/external/externallib.php',
850 'description' => 'Return some translated strings - like several core get_string() calls',
851 'type' => 'read',
852 ),
853
854 'core_get_component_strings' => array(
855 'classname' => 'core_external',
856 'methodname' => 'get_component_strings',
857 'classpath' => 'lib/external/externallib.php',
858 'description' => 'Return all raw strings (with {$a->xxx}) for a specific component
859 - similar to core get_component_strings() call',
860 'type' => 'read',
861 ),
5e1350ab
AA
862
863
864 // === Calendar related functions ===
865
866 'core_calendar_delete_calendar_events' => array(
867 'classname' => 'core_calendar_external',
868 'methodname' => 'delete_calendar_events',
869 'description' => 'Delete calendar events',
870 'classpath' => 'calendar/externallib.php',
871 'type' => 'write',
872 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
873 ),
874
793d3855
AA
875
876 'core_calendar_get_calendar_events' => array(
877 'classname' => 'core_calendar_external',
878 'methodname' => 'get_calendar_events',
879 'description' => 'Get calendar events',
880 'classpath' => 'calendar/externallib.php',
881 'type' => 'read',
882 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
883 ),
884
c66dc3df
AA
885 'core_calendar_create_calendar_events' => array(
886 'classname' => 'core_calendar_external',
887 'methodname' => 'create_calendar_events',
888 'description' => 'Create calendar events',
889 'classpath' => 'calendar/externallib.php',
890 'type' => 'write',
891 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
892 ),
9a0df45a 893);
c1b65883
JM
894
895$services = array(
96e0194c
SH
896 'Moodle mobile web service' => array(
897 'functions' => array (
898 'moodle_enrol_get_users_courses',
899 'moodle_enrol_get_enrolled_users',
f2806b9a
JM
900 'moodle_user_get_users_by_id',
901 'moodle_webservice_get_siteinfo',
902 'moodle_notes_create_notes',
ea4e96c2 903 'moodle_user_get_course_participants_by_id',
01479290 904 'moodle_user_get_users_by_courseid',
ec0d6ea2 905 'moodle_message_send_instantmessages',
11e76602 906 'core_course_get_contents',
6a403810 907 'core_get_component_strings',
925f4d6b 908 'core_user_add_user_device',
cb9d8257
JL
909 'core_calendar_get_calendar_events',
910 'core_enrol_get_users_courses',
911 'core_enrol_get_enrolled_users',
912 'core_user_get_users_by_id',
913 'core_webservice_get_site_info',
914 'core_notes_create_notes',
915 'core_user_get_course_user_profiles',
916 'core_enrol_get_enrolled_users',
917 'core_message_send_instant_messages'),
96e0194c
SH
918 'enabled' => 0,
919 'restrictedusers' => 0,
af03513f 920 'shortname' => MOODLE_OFFICIAL_MOBILE_SERVICE,
106c55fb
DW
921 'downloadfiles' => 1,
922 'uploadfiles' => 1
96e0194c
SH
923 ),
924);