MDL-41914 New table user_devices
[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
72f68b51 440 // === enrol related functions ===
d0068cd0 441
b6b6c7ac
PC
442 'core_enrol_get_enrolled_users_with_capability' => array(
443 'classname' => 'core_enrol_external',
444 'methodname' => 'get_enrolled_users_with_capability',
445 'classpath' => 'enrol/externallib.php',
446 'description' => 'For each course and capability specified, return a list of the users that are enrolled in the course
447 and have that capability',
448 'type' => 'read',
449 ),
72f68b51 450
df997f84
PS
451 'moodle_enrol_get_enrolled_users' => array(
452 'classname' => 'moodle_enrol_external',
453 'methodname' => 'get_enrolled_users',
454 'classpath' => 'enrol/externallib.php',
5d1017e1 455 '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 456 'type' => 'read',
72f68b51 457 'capabilities'=> 'moodle/site:viewparticipants, moodle/course:viewparticipants,
458 moodle/role:review, moodle/site:accessallgroups, moodle/course:enrolreview',
df997f84 459 ),
e6acc551 460
5d1017e1
JM
461 'core_enrol_get_enrolled_users' => array(
462 'classname' => 'core_enrol_external',
463 'methodname' => 'get_enrolled_users',
464 'classpath' => 'enrol/externallib.php',
465 'description' => 'Get enrolled users by course id.',
466 'type' => 'read',
467 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
468 ),
df997f84 469
3364dbb5 470 'moodle_enrol_get_users_courses' => array(
5d1017e1 471 'classname' => 'core_enrol_external',
3364dbb5
PS
472 'methodname' => 'get_users_courses',
473 'classpath' => 'enrol/externallib.php',
5d1017e1 474 '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
475 'type' => 'read',
476 'capabilities'=> 'moodle/course:viewparticipants',
477 ),
478
5d1017e1
JM
479 'core_enrol_get_users_courses' => array(
480 'classname' => 'core_enrol_external',
481 'methodname' => 'get_users_courses',
482 'classpath' => 'enrol/externallib.php',
483 'description' => 'Get the list of courses where a user is enrolled in',
484 'type' => 'read',
485 'capabilities'=> 'moodle/course:viewparticipants',
486 ),
487
be9bf94e
RT
488 'core_enrol_get_course_enrolment_methods' => array(
489 'classname' => 'core_enrol_external',
490 'methodname' => 'get_course_enrolment_methods',
491 'classpath' => 'enrol/externallib.php',
492 'description' => 'Get the list of course enrolment methods',
493 'type' => 'read',
494 ),
495
5d1017e1
JM
496 // === Role related functions ===
497
df997f84 498 'moodle_role_assign' => array(
5d1017e1
JM
499 'classname' => 'core_role_external',
500 'methodname' => 'assign_roles',
501 'classpath' => 'enrol/externallib.php',
502 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_role_assign_role()',
503 'type' => 'write',
504 'capabilities'=> 'moodle/role:assign',
505 ),
506
507 'core_role_assign_roles' => array(
508 'classname' => 'core_role_external',
509 'methodname' => 'assign_roles',
e9b66095 510 'classpath' => 'enrol/externallib.php',
df997f84 511 'description' => 'Manual role assignments.',
e9b66095 512 'type' => 'write',
72f68b51 513 'capabilities'=> 'moodle/role:assign',
e9b66095 514 ),
515
df997f84 516 'moodle_role_unassign' => array(
5d1017e1
JM
517 'classname' => 'core_role_external',
518 'methodname' => 'unassign_roles',
519 'classpath' => 'enrol/externallib.php',
520 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_role_unassign_role()',
521 'type' => 'write',
522 'capabilities'=> 'moodle/role:assign',
523 ),
524
525 'core_role_unassign_roles' => array(
526 'classname' => 'core_role_external',
527 'methodname' => 'unassign_roles',
e9b66095 528 'classpath' => 'enrol/externallib.php',
df997f84 529 'description' => 'Manual role unassignments.',
e9b66095 530 'type' => 'write',
72f68b51 531 'capabilities'=> 'moodle/role:assign',
e9b66095 532 ),
5b4a78e2 533
6bb31e40 534 // === course related functions ===
535
3ec163dd 536 'core_course_get_contents' => array(
d4a246bc 537 'classname' => 'core_course_external',
3ec163dd 538 'methodname' => 'get_course_contents',
d4a246bc 539 'classpath' => 'course/externallib.php',
3ec163dd 540 'description' => 'Get course contents',
d4a246bc 541 'type' => 'read',
3ec163dd 542 'capabilities'=> 'moodle/course:update,moodle/course:viewhiddencourses',
f2229c68 543 ),
d6ebe011 544
6bb31e40 545 'moodle_course_get_courses' => array(
5d1017e1
JM
546 'classname' => 'core_course_external',
547 'methodname' => 'get_courses',
548 'classpath' => 'course/externallib.php',
549 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_course_get_courses()',
550 'type' => 'read',
551 'capabilities'=> 'moodle/course:view,moodle/course:update,moodle/course:viewhiddencourses',
552 ),
553
554 'core_course_get_courses' => array(
555 'classname' => 'core_course_external',
6bb31e40 556 'methodname' => 'get_courses',
557 'classpath' => 'course/externallib.php',
558 'description' => 'Return course details',
559 'type' => 'read',
560 'capabilities'=> 'moodle/course:view,moodle/course:update,moodle/course:viewhiddencourses',
561 ),
562
563 'moodle_course_create_courses' => array(
5d1017e1
JM
564 'classname' => 'core_course_external',
565 'methodname' => 'create_courses',
566 'classpath' => 'course/externallib.php',
567 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_course_create_courses()',
568 'type' => 'write',
569 'capabilities'=> 'moodle/course:create,moodle/course:visibility',
570 ),
571
572 'core_course_create_courses' => array(
573 'classname' => 'core_course_external',
6bb31e40 574 'methodname' => 'create_courses',
575 'classpath' => 'course/externallib.php',
576 'description' => 'Create new courses',
577 'type' => 'write',
578 'capabilities'=> 'moodle/course:create,moodle/course:visibility',
579 ),
580
63a85dc7
JL
581 'core_course_delete_courses' => array(
582 'classname' => 'core_course_external',
583 'methodname' => 'delete_courses',
584 'classpath' => 'course/externallib.php',
585 'description' => 'Deletes all specified courses',
586 'type' => 'write',
587 'capabilities'=> 'moodle/course:delete',
588 ),
589
79949c1b
MN
590 'core_course_delete_modules' => array(
591 'classname' => 'core_course_external',
592 'methodname' => 'delete_modules',
593 'classpath' => 'course/externallib.php',
594 'description' => 'Deletes all specified module instances',
595 'type' => 'write',
596 'capabilities' => 'moodle/course:manageactivities'
597 ),
598
3dc1d76e
JL
599 'core_course_duplicate_course' => array(
600 'classname' => 'core_course_external',
601 'methodname' => 'duplicate_course',
602 'classpath' => 'course/externallib.php',
603 'description' => 'Duplicate an existing course (creating a new one) without user data',
604 'type' => 'write',
605 'capabilities'=> 'moodle/backup:backupcourse,moodle/restore:restorecourse,moodle/course:create',
606 ),
607
791723c3
RT
608 'core_course_update_courses' => array(
609 'classname' => 'core_course_external',
610 'methodname' => 'update_courses',
611 'classpath' => 'course/externallib.php',
612 'description' => 'Update courses',
613 'type' => 'write',
614 'capabilities'=> 'moodle/course:update,moodle/course:changecategory,moodle/course:changefullname,moodle/course:changeshortname,moodle/course:changeidnumber,moodle/course:changesummary,moodle/course:visibility',
615 ),
616
3ec163dd
EL
617 // === course category related functions ===
618
619 'core_course_get_categories' => array(
620 'classname' => 'core_course_external',
621 'methodname' => 'get_categories',
622 'classpath' => 'course/externallib.php',
623 'description' => 'Return category details',
624 'type' => 'read',
625 'capabilities'=> 'moodle/category:viewhiddencategories',
626 ),
627
479a5db1
FS
628 'core_course_create_categories' => array(
629 'classname' => 'core_course_external',
630 'methodname' => 'create_categories',
631 'classpath' => 'course/externallib.php',
632 'description' => 'Create course categories',
633 'type' => 'write',
634 'capabilities'=> 'moodle/category:manage',
635 ),
d6ebe011 636
3ec163dd
EL
637 'core_course_update_categories' => array(
638 'classname' => 'core_course_external',
639 'methodname' => 'update_categories',
640 'classpath' => 'course/externallib.php',
641 'description' => 'Update categories',
642 'type' => 'write',
afe27edc 643 'capabilities'=> 'moodle/category:manage',
3ec163dd
EL
644 ),
645
2f951d86
FS
646 'core_course_delete_categories' => array(
647 'classname' => 'core_course_external',
648 'methodname' => 'delete_categories',
649 'classpath' => 'course/externallib.php',
650 'description' => 'Delete course categories',
651 'type' => 'write',
652 'capabilities'=> 'moodle/category:manage',
653 ),
479a5db1 654
8430d87b
JL
655 'core_course_import_course' => array(
656 'classname' => 'core_course_external',
657 'methodname' => 'import_course',
658 'classpath' => 'course/externallib.php',
659 'description' => 'Import course data from a course into another course. Does not include any user data.',
660 'type' => 'write',
661 'capabilities'=> 'moodle/backup:backuptargetimport, moodle/restore:restoretargetimport',
662 ),
663
a623b6b8
JM
664 // === message related functions ===
665
4de00da7 666 'moodle_message_send_instantmessages' => array(
5d1017e1
JM
667 'classname' => 'core_message_external',
668 'methodname' => 'send_instant_messages',
669 'classpath' => 'message/externallib.php',
670 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_message_send_instant_messages()',
671 'type' => 'write',
672 'capabilities'=> 'moodle/site:sendmessage',
673 ),
674
675 'core_message_send_instant_messages' => array(
676 'classname' => 'core_message_external',
677 'methodname' => 'send_instant_messages',
a623b6b8 678 'classpath' => 'message/externallib.php',
4de00da7 679 'description' => 'Send instant messages',
a623b6b8
JM
680 'type' => 'write',
681 'capabilities'=> 'moodle/site:sendmessage',
682 ),
683
d6731600
FM
684 'core_message_create_contacts' => array(
685 'classname' => 'core_message_external',
686 'methodname' => 'create_contacts',
687 'classpath' => 'message/externallib.php',
688 'description' => 'Add contacts to the contact list',
689 'type' => 'write',
690 'capabilities'=> '',
691 ),
692
693 'core_message_delete_contacts' => array(
694 'classname' => 'core_message_external',
695 'methodname' => 'delete_contacts',
696 'classpath' => 'message/externallib.php',
697 'description' => 'Remove contacts from the contact list',
698 'type' => 'write',
699 'capabilities'=> '',
700 ),
701
702 'core_message_block_contacts' => array(
703 'classname' => 'core_message_external',
704 'methodname' => 'block_contacts',
705 'classpath' => 'message/externallib.php',
706 'description' => 'Block contacts',
707 'type' => 'write',
708 'capabilities'=> '',
709 ),
710
711 'core_message_unblock_contacts' => array(
712 'classname' => 'core_message_external',
713 'methodname' => 'unblock_contacts',
714 'classpath' => 'message/externallib.php',
715 'description' => 'Unblock contacts',
716 'type' => 'write',
717 'capabilities'=> '',
718 ),
719
720 'core_message_get_contacts' => array(
721 'classname' => 'core_message_external',
722 'methodname' => 'get_contacts',
723 'classpath' => 'message/externallib.php',
724 'description' => 'Retrieve the contact list',
725 'type' => 'read',
726 'capabilities'=> '',
727 ),
728
729 'core_message_search_contacts' => array(
730 'classname' => 'core_message_external',
731 'methodname' => 'search_contacts',
732 'classpath' => 'message/externallib.php',
733 'description' => 'Search for contacts',
734 'type' => 'read',
735 'capabilities'=> '',
736 ),
737
8d46dabb
JM
738 // === notes related functions ===
739
740 'moodle_notes_create_notes' => array(
5d1017e1
JM
741 'classname' => 'core_notes_external',
742 'methodname' => 'create_notes',
743 'classpath' => 'notes/externallib.php',
744 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_notes_create_notes()',
745 'type' => 'write',
746 'capabilities'=> 'moodle/notes:manage',
747 ),
748
749 'core_notes_create_notes' => array(
750 'classname' => 'core_notes_external',
8d46dabb
JM
751 'methodname' => 'create_notes',
752 'classpath' => 'notes/externallib.php',
753 'description' => 'Create notes',
754 'type' => 'write',
755 'capabilities'=> 'moodle/notes:manage',
756 ),
757
34348b2b
JF
758 'core_notes_delete_notes' => array(
759 'classname' => 'core_notes_external',
760 'methodname' => 'delete_notes',
761 'classpath' => 'notes/externallib.php',
762 'description' => 'Delete notes',
763 'type' => 'write',
764 'capabilities'=> 'moodle/notes:manage',
765 ),
766
767 'core_notes_get_notes' => array(
768 'classname' => 'core_notes_external',
769 'methodname' => 'get_notes',
770 'classpath' => 'notes/externallib.php',
771 'description' => 'Get notes',
772 'type' => 'read',
773 'capabilities'=> 'moodle/notes:view',
774 ),
775
776 'core_notes_update_notes' => array(
777 'classname' => 'core_notes_external',
778 'methodname' => 'update_notes',
779 'classpath' => 'notes/externallib.php',
780 'description' => 'Update notes',
781 'type' => 'write',
782 'capabilities'=> 'moodle/notes:manage',
783 ),
784
9028d9b5
PC
785 // === grading related functions ===
786
787 'core_grading_get_definitions' => array(
788 'classname' => 'core_grading_external',
789 'methodname' => 'get_definitions',
790 'classpath' => 'grade/externallib.php',
791 'description' => 'Get grading definitions',
792 'type' => 'read'
793 ),
3f0ea6d8
PC
794
795 'core_grade_get_definitions' => array(
796 'classname' => 'core_grade_external',
797 'methodname' => 'get_definitions',
798 'classpath' => 'grade/externallib.php',
9028d9b5
PC
799 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_grading_get_definitions()',
800 'type' => 'read'
801 ),
802
803 'core_grading_get_gradingform_instances' => array(
804 'classname' => 'core_grading_external',
805 'methodname' => 'get_gradingform_instances',
806 'classpath' => 'grade/externallib.php',
807 'description' => 'Get grading form instances',
3f0ea6d8
PC
808 'type' => 'read'
809 ),
810
0bf486a6
JM
811 // === webservice related functions ===
812
813 'moodle_webservice_get_siteinfo' => array(
5d1017e1
JM
814 'classname' => 'core_webservice_external',
815 'methodname' => 'get_site_info',
816 'classpath' => 'webservice/externallib.php',
817 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_webservice_get_site_info()',
818 'type' => 'read',
819 ),
820
821 'core_webservice_get_site_info' => array(
822 'classname' => 'core_webservice_external',
823 'methodname' => 'get_site_info',
0bf486a6
JM
824 'classpath' => 'webservice/externallib.php',
825 'description' => 'Return some site info / user info / list web service functions',
826 'type' => 'read',
827 ),
828
11e76602
JM
829 'core_get_string' => array(
830 'classname' => 'core_external',
831 'methodname' => 'get_string',
832 'classpath' => 'lib/external/externallib.php',
833 'description' => 'Return a translated string - similar to core get_string() call',
834 'type' => 'read',
835 ),
836
837 'core_get_strings' => array(
838 'classname' => 'core_external',
839 'methodname' => 'get_strings',
840 'classpath' => 'lib/external/externallib.php',
841 'description' => 'Return some translated strings - like several core get_string() calls',
842 'type' => 'read',
843 ),
844
845 'core_get_component_strings' => array(
846 'classname' => 'core_external',
847 'methodname' => 'get_component_strings',
848 'classpath' => 'lib/external/externallib.php',
849 'description' => 'Return all raw strings (with {$a->xxx}) for a specific component
850 - similar to core get_component_strings() call',
851 'type' => 'read',
852 ),
5e1350ab
AA
853
854
855 // === Calendar related functions ===
856
857 'core_calendar_delete_calendar_events' => array(
858 'classname' => 'core_calendar_external',
859 'methodname' => 'delete_calendar_events',
860 'description' => 'Delete calendar events',
861 'classpath' => 'calendar/externallib.php',
862 'type' => 'write',
863 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
864 ),
865
793d3855
AA
866
867 'core_calendar_get_calendar_events' => array(
868 'classname' => 'core_calendar_external',
869 'methodname' => 'get_calendar_events',
870 'description' => 'Get calendar events',
871 'classpath' => 'calendar/externallib.php',
872 'type' => 'read',
873 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
874 ),
875
c66dc3df
AA
876 'core_calendar_create_calendar_events' => array(
877 'classname' => 'core_calendar_external',
878 'methodname' => 'create_calendar_events',
879 'description' => 'Create calendar events',
880 'classpath' => 'calendar/externallib.php',
881 'type' => 'write',
882 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
883 ),
9a0df45a 884);
c1b65883
JM
885
886$services = array(
96e0194c
SH
887 'Moodle mobile web service' => array(
888 'functions' => array (
889 'moodle_enrol_get_users_courses',
890 'moodle_enrol_get_enrolled_users',
f2806b9a
JM
891 'moodle_user_get_users_by_id',
892 'moodle_webservice_get_siteinfo',
893 'moodle_notes_create_notes',
ea4e96c2 894 'moodle_user_get_course_participants_by_id',
01479290 895 'moodle_user_get_users_by_courseid',
ec0d6ea2 896 'moodle_message_send_instantmessages',
11e76602
JM
897 'core_course_get_contents',
898 'core_get_component_strings'),
96e0194c
SH
899 'enabled' => 0,
900 'restrictedusers' => 0,
af03513f 901 'shortname' => MOODLE_OFFICIAL_MOBILE_SERVICE,
106c55fb
DW
902 'downloadfiles' => 1,
903 'uploadfiles' => 1
96e0194c
SH
904 ),
905);