MDL-47153 tool_monitor: added rule_updated event
[moodle.git] / lib / db / services.php
blobe01a493a781a0eee6afd9981c1ab294984d0d17f
1 <?php
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.
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/>.
18 /**
19 * Core external functions and service definitions.
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.
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}
30 * @package core_webservice
31 * @category webservice
32 * @copyright 2009 Petr Skodak
33 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
36 $functions = array(
38 // Cohort related functions.
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',
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',
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',
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',
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',
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',
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',
102 // Grade related functions.
104 'core_grades_get_grades' => array(
105 'classname' => 'core_grades_external',
106 'methodname' => 'get_grades',
107 'description' => 'Returns grade item details and optionally student grades.',
108 'type' => 'read',
109 'capabilities' => 'moodle/grade:view, moodle/grade:viewall',
112 'core_grades_update_grades' => array(
113 'classname' => 'core_grades_external',
114 'methodname' => 'update_grades',
115 'description' => 'Update a grade item and associated student grades.',
116 'type' => 'write',
117 'capabilities' => '',
120 // === group related functions ===
122 'moodle_group_create_groups' => array(
123 'classname' => 'core_group_external',
124 'methodname' => 'create_groups',
125 'classpath' => 'group/externallib.php',
126 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_group_create_groups(). ',
127 'type' => 'write',
128 'capabilities'=> 'moodle/course:managegroups',
131 'core_group_create_groups' => array(
132 'classname' => 'core_group_external',
133 'methodname' => 'create_groups',
134 'classpath' => 'group/externallib.php',
135 'description' => 'Creates new groups.',
136 'type' => 'write',
137 'capabilities'=> 'moodle/course:managegroups',
140 'moodle_group_get_groups' => array(
141 'classname' => 'core_group_external',
142 'methodname' => 'get_groups',
143 'classpath' => 'group/externallib.php',
144 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_group_get_groups()',
145 'type' => 'read',
146 'capabilities'=> 'moodle/course:managegroups',
149 'core_group_get_groups' => array(
150 'classname' => 'core_group_external',
151 'methodname' => 'get_groups',
152 'classpath' => 'group/externallib.php',
153 'description' => 'Returns group details.',
154 'type' => 'read',
155 'capabilities'=> 'moodle/course:managegroups',
158 'moodle_group_get_course_groups' => array(
159 'classname' => 'core_group_external',
160 'methodname' => 'get_course_groups',
161 'classpath' => 'group/externallib.php',
162 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_group_get_course_groups()',
163 'type' => 'read',
164 'capabilities'=> 'moodle/course:managegroups',
167 'core_group_get_course_groups' => array(
168 'classname' => 'core_group_external',
169 'methodname' => 'get_course_groups',
170 'classpath' => 'group/externallib.php',
171 'description' => 'Returns all groups in specified course.',
172 'type' => 'read',
173 'capabilities'=> 'moodle/course:managegroups',
176 'moodle_group_delete_groups' => array(
177 'classname' => 'core_group_external',
178 'methodname' => 'delete_groups',
179 'classpath' => 'group/externallib.php',
180 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_group_delete_groups()',
181 'type' => 'delete',
182 'capabilities'=> 'moodle/course:managegroups',
185 'core_group_delete_groups' => array(
186 'classname' => 'core_group_external',
187 'methodname' => 'delete_groups',
188 'classpath' => 'group/externallib.php',
189 'description' => 'Deletes all specified groups.',
190 'type' => 'delete',
191 'capabilities'=> 'moodle/course:managegroups',
194 'moodle_group_get_groupmembers' => array(
195 'classname' => 'core_group_external',
196 'methodname' => 'get_group_members',
197 'classpath' => 'group/externallib.php',
198 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_group_get_group_members()',
199 'type' => 'read',
200 'capabilities'=> 'moodle/course:managegroups',
203 'core_group_get_group_members' => array(
204 'classname' => 'core_group_external',
205 'methodname' => 'get_group_members',
206 'classpath' => 'group/externallib.php',
207 'description' => 'Returns group members.',
208 'type' => 'read',
209 'capabilities'=> 'moodle/course:managegroups',
212 'moodle_group_add_groupmembers' => array(
213 'classname' => 'core_group_external',
214 'methodname' => 'add_group_members',
215 'classpath' => 'group/externallib.php',
216 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_group_add_group_members()',
217 'type' => 'write',
218 'capabilities'=> 'moodle/course:managegroups',
221 'core_group_add_group_members' => array(
222 'classname' => 'core_group_external',
223 'methodname' => 'add_group_members',
224 'classpath' => 'group/externallib.php',
225 'description' => 'Adds group members.',
226 'type' => 'write',
227 'capabilities'=> 'moodle/course:managegroups',
230 'moodle_group_delete_groupmembers' => array(
231 'classname' => 'core_group_external',
232 'methodname' => 'delete_group_members',
233 'classpath' => 'group/externallib.php',
234 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_group_delete_group_members()',
235 'type' => 'delete',
236 'capabilities'=> 'moodle/course:managegroups',
239 'core_group_delete_group_members' => array(
240 'classname' => 'core_group_external',
241 'methodname' => 'delete_group_members',
242 'classpath' => 'group/externallib.php',
243 'description' => 'Deletes group members.',
244 'type' => 'delete',
245 'capabilities'=> 'moodle/course:managegroups',
248 'core_group_create_groupings' => array(
249 'classname' => 'core_group_external',
250 'methodname' => 'create_groupings',
251 'classpath' => 'group/externallib.php',
252 'description' => 'Creates new groupings',
253 'type' => 'write',
256 'core_group_update_groupings' => array(
257 'classname' => 'core_group_external',
258 'methodname' => 'update_groupings',
259 'classpath' => 'group/externallib.php',
260 'description' => 'Updates existing groupings',
261 'type' => 'write',
264 'core_group_get_groupings' => array(
265 'classname' => 'core_group_external',
266 'methodname' => 'get_groupings',
267 'classpath' => 'group/externallib.php',
268 'description' => 'Returns groupings details.',
269 'type' => 'read',
272 'core_group_get_course_groupings' => array(
273 'classname' => 'core_group_external',
274 'methodname' => 'get_course_groupings',
275 'classpath' => 'group/externallib.php',
276 'description' => 'Returns all groupings in specified course.',
277 'type' => 'read',
280 'core_group_delete_groupings' => array(
281 'classname' => 'core_group_external',
282 'methodname' => 'delete_groupings',
283 'classpath' => 'group/externallib.php',
284 'description' => 'Deletes all specified groupings.',
285 'type' => 'write',
288 'core_group_assign_grouping' => array(
289 'classname' => 'core_group_external',
290 'methodname' => 'assign_grouping',
291 'classpath' => 'group/externallib.php',
292 'description' => 'Assing groups from groupings',
293 'type' => 'write',
296 'core_group_unassign_grouping' => array(
297 'classname' => 'core_group_external',
298 'methodname' => 'unassign_grouping',
299 'classpath' => 'group/externallib.php',
300 'description' => 'Unassing groups from groupings',
301 'type' => 'write',
304 // === file related functions ===
306 'moodle_file_get_files' => array(
307 'classname' => 'core_files_external',
308 'methodname' => 'get_files',
309 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_files_get_files()',
310 'type' => 'read',
311 'classpath' => 'files/externallib.php',
314 'core_files_get_files' => array(
315 'classname' => 'core_files_external',
316 'methodname' => 'get_files',
317 'description' => 'browse moodle files',
318 'type' => 'read',
319 'classpath' => 'files/externallib.php',
322 'moodle_file_upload' => array(
323 'classname' => 'core_files_external',
324 'methodname' => 'upload',
325 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_files_upload()',
326 'type' => 'write',
327 'classpath' => 'files/externallib.php',
330 'core_files_upload' => array(
331 'classname' => 'core_files_external',
332 'methodname' => 'upload',
333 'description' => 'upload a file to moodle',
334 'type' => 'write',
335 'classpath' => 'files/externallib.php',
338 // === user related functions ===
340 'moodle_user_create_users' => array(
341 'classname' => 'core_user_external',
342 'methodname' => 'create_users',
343 'classpath' => 'user/externallib.php',
344 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_user_create_users()',
345 'type' => 'write',
346 'capabilities'=> 'moodle/user:create',
349 'core_user_create_users' => array(
350 'classname' => 'core_user_external',
351 'methodname' => 'create_users',
352 'classpath' => 'user/externallib.php',
353 'description' => 'Create users.',
354 'type' => 'write',
355 'capabilities'=> 'moodle/user:create',
358 'core_user_get_users' => array(
359 'classname' => 'core_user_external',
360 'methodname' => 'get_users',
361 'classpath' => 'user/externallib.php',
362 'description' => 'search for users matching the parameters',
363 'type' => 'read',
364 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
367 'moodle_user_get_users_by_id' => array(
368 'classname' => 'core_user_external',
369 'methodname' => 'get_users_by_id',
370 'classpath' => 'user/externallib.php',
371 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_user_get_users_by_id()',
372 'type' => 'read',
373 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
376 'core_user_get_users_by_field' => array(
377 'classname' => 'core_user_external',
378 'methodname' => 'get_users_by_field',
379 'classpath' => 'user/externallib.php',
380 'description' => 'Retrieve users information for a specified unique field - If you want to do a user search, use core_user_get_users()',
381 'type' => 'read',
382 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
385 'core_user_get_users_by_id' => array(
386 'classname' => 'core_user_external',
387 'methodname' => 'get_users_by_id',
388 'classpath' => 'user/externallib.php',
389 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been replaced by core_user_get_users_by_field()',
390 'type' => 'read',
391 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update',
394 'moodle_user_get_users_by_courseid' => array(
395 'classname' => 'core_enrol_external',
396 'methodname' => 'get_enrolled_users',
397 'classpath' => 'enrol/externallib.php',
398 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_enrol_get_enrolled_users()',
399 'type' => 'read',
400 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
403 'moodle_user_get_course_participants_by_id' => array(
404 'classname' => 'core_user_external',
405 'methodname' => 'get_course_user_profiles',
406 'classpath' => 'user/externallib.php',
407 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_user_get_course_user_profiles()',
408 'type' => 'read',
409 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
412 'core_user_get_course_user_profiles' => array(
413 'classname' => 'core_user_external',
414 'methodname' => 'get_course_user_profiles',
415 'classpath' => 'user/externallib.php',
416 'description' => 'Get course user profiles (each of the profils matching a course id and a user id).',
417 'type' => 'read',
418 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
421 'moodle_user_delete_users' => array(
422 'classname' => 'core_user_external',
423 'methodname' => 'delete_users',
424 'classpath' => 'user/externallib.php',
425 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_user_delete_users()',
426 'type' => 'write',
427 'capabilities'=> 'moodle/user:delete',
430 'core_user_delete_users' => array(
431 'classname' => 'core_user_external',
432 'methodname' => 'delete_users',
433 'classpath' => 'user/externallib.php',
434 'description' => 'Delete users.',
435 'type' => 'write',
436 'capabilities'=> 'moodle/user:delete',
439 'moodle_user_update_users' => array(
440 'classname' => 'core_user_external',
441 'methodname' => 'update_users',
442 'classpath' => 'user/externallib.php',
443 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_user_update_users()',
444 'type' => 'write',
445 'capabilities'=> 'moodle/user:update',
448 'core_user_update_users' => array(
449 'classname' => 'core_user_external',
450 'methodname' => 'update_users',
451 'classpath' => 'user/externallib.php',
452 'description' => 'Update users.',
453 'type' => 'write',
454 'capabilities'=> 'moodle/user:update',
457 'core_user_add_user_device' => array(
458 'classname' => 'core_user_external',
459 'methodname' => 'add_user_device',
460 'classpath' => 'user/externallib.php',
461 'description' => 'Store mobile user devices information for PUSH Notifications.',
462 'type' => 'write',
463 'capabilities'=> '',
466 // === enrol related functions ===
468 'core_enrol_get_enrolled_users_with_capability' => array(
469 'classname' => 'core_enrol_external',
470 'methodname' => 'get_enrolled_users_with_capability',
471 'classpath' => 'enrol/externallib.php',
472 'description' => 'For each course and capability specified, return a list of the users that are enrolled in the course
473 and have that capability',
474 'type' => 'read',
477 'moodle_enrol_get_enrolled_users' => array(
478 'classname' => 'moodle_enrol_external',
479 'methodname' => 'get_enrolled_users',
480 'classpath' => 'enrol/externallib.php',
481 '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).',
482 'type' => 'read',
483 'capabilities'=> 'moodle/site:viewparticipants, moodle/course:viewparticipants,
484 moodle/role:review, moodle/site:accessallgroups, moodle/course:enrolreview',
487 'core_enrol_get_enrolled_users' => array(
488 'classname' => 'core_enrol_external',
489 'methodname' => 'get_enrolled_users',
490 'classpath' => 'enrol/externallib.php',
491 'description' => 'Get enrolled users by course id.',
492 'type' => 'read',
493 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups',
496 'moodle_enrol_get_users_courses' => array(
497 'classname' => 'core_enrol_external',
498 'methodname' => 'get_users_courses',
499 'classpath' => 'enrol/externallib.php',
500 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_enrol_get_users_courses()',
501 'type' => 'read',
502 'capabilities'=> 'moodle/course:viewparticipants',
505 'core_enrol_get_users_courses' => array(
506 'classname' => 'core_enrol_external',
507 'methodname' => 'get_users_courses',
508 'classpath' => 'enrol/externallib.php',
509 'description' => 'Get the list of courses where a user is enrolled in',
510 'type' => 'read',
511 'capabilities'=> 'moodle/course:viewparticipants',
514 'core_enrol_get_course_enrolment_methods' => array(
515 'classname' => 'core_enrol_external',
516 'methodname' => 'get_course_enrolment_methods',
517 'classpath' => 'enrol/externallib.php',
518 'description' => 'Get the list of course enrolment methods',
519 'type' => 'read',
522 // === Role related functions ===
524 'moodle_role_assign' => array(
525 'classname' => 'core_role_external',
526 'methodname' => 'assign_roles',
527 'classpath' => 'enrol/externallib.php',
528 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_role_assign_role()',
529 'type' => 'write',
530 'capabilities'=> 'moodle/role:assign',
533 'core_role_assign_roles' => array(
534 'classname' => 'core_role_external',
535 'methodname' => 'assign_roles',
536 'classpath' => 'enrol/externallib.php',
537 'description' => 'Manual role assignments.',
538 'type' => 'write',
539 'capabilities'=> 'moodle/role:assign',
542 'moodle_role_unassign' => array(
543 'classname' => 'core_role_external',
544 'methodname' => 'unassign_roles',
545 'classpath' => 'enrol/externallib.php',
546 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_role_unassign_role()',
547 'type' => 'write',
548 'capabilities'=> 'moodle/role:assign',
551 'core_role_unassign_roles' => array(
552 'classname' => 'core_role_external',
553 'methodname' => 'unassign_roles',
554 'classpath' => 'enrol/externallib.php',
555 'description' => 'Manual role unassignments.',
556 'type' => 'write',
557 'capabilities'=> 'moodle/role:assign',
560 // === course related functions ===
562 'core_course_get_contents' => array(
563 'classname' => 'core_course_external',
564 'methodname' => 'get_course_contents',
565 'classpath' => 'course/externallib.php',
566 'description' => 'Get course contents',
567 'type' => 'read',
568 'capabilities'=> 'moodle/course:update,moodle/course:viewhiddencourses',
571 'moodle_course_get_courses' => array(
572 'classname' => 'core_course_external',
573 'methodname' => 'get_courses',
574 'classpath' => 'course/externallib.php',
575 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_course_get_courses()',
576 'type' => 'read',
577 'capabilities'=> 'moodle/course:view,moodle/course:update,moodle/course:viewhiddencourses',
580 'core_course_get_courses' => array(
581 'classname' => 'core_course_external',
582 'methodname' => 'get_courses',
583 'classpath' => 'course/externallib.php',
584 'description' => 'Return course details',
585 'type' => 'read',
586 'capabilities'=> 'moodle/course:view,moodle/course:update,moodle/course:viewhiddencourses',
589 'moodle_course_create_courses' => array(
590 'classname' => 'core_course_external',
591 'methodname' => 'create_courses',
592 'classpath' => 'course/externallib.php',
593 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_course_create_courses()',
594 'type' => 'write',
595 'capabilities'=> 'moodle/course:create,moodle/course:visibility',
598 'core_course_create_courses' => array(
599 'classname' => 'core_course_external',
600 'methodname' => 'create_courses',
601 'classpath' => 'course/externallib.php',
602 'description' => 'Create new courses',
603 'type' => 'write',
604 'capabilities'=> 'moodle/course:create,moodle/course:visibility',
607 'core_course_delete_courses' => array(
608 'classname' => 'core_course_external',
609 'methodname' => 'delete_courses',
610 'classpath' => 'course/externallib.php',
611 'description' => 'Deletes all specified courses',
612 'type' => 'write',
613 'capabilities'=> 'moodle/course:delete',
616 'core_course_delete_modules' => array(
617 'classname' => 'core_course_external',
618 'methodname' => 'delete_modules',
619 'classpath' => 'course/externallib.php',
620 'description' => 'Deletes all specified module instances',
621 'type' => 'write',
622 'capabilities' => 'moodle/course:manageactivities'
625 'core_course_duplicate_course' => array(
626 'classname' => 'core_course_external',
627 'methodname' => 'duplicate_course',
628 'classpath' => 'course/externallib.php',
629 'description' => 'Duplicate an existing course (creating a new one) without user data',
630 'type' => 'write',
631 'capabilities'=> 'moodle/backup:backupcourse,moodle/restore:restorecourse,moodle/course:create',
634 'core_course_update_courses' => array(
635 'classname' => 'core_course_external',
636 'methodname' => 'update_courses',
637 'classpath' => 'course/externallib.php',
638 'description' => 'Update courses',
639 'type' => 'write',
640 'capabilities'=> 'moodle/course:update,moodle/course:changecategory,moodle/course:changefullname,moodle/course:changeshortname,moodle/course:changeidnumber,moodle/course:changesummary,moodle/course:visibility',
643 // === course category related functions ===
645 'core_course_get_categories' => array(
646 'classname' => 'core_course_external',
647 'methodname' => 'get_categories',
648 'classpath' => 'course/externallib.php',
649 'description' => 'Return category details',
650 'type' => 'read',
651 'capabilities'=> 'moodle/category:viewhiddencategories',
654 'core_course_create_categories' => array(
655 'classname' => 'core_course_external',
656 'methodname' => 'create_categories',
657 'classpath' => 'course/externallib.php',
658 'description' => 'Create course categories',
659 'type' => 'write',
660 'capabilities'=> 'moodle/category:manage',
663 'core_course_update_categories' => array(
664 'classname' => 'core_course_external',
665 'methodname' => 'update_categories',
666 'classpath' => 'course/externallib.php',
667 'description' => 'Update categories',
668 'type' => 'write',
669 'capabilities'=> 'moodle/category:manage',
672 'core_course_delete_categories' => array(
673 'classname' => 'core_course_external',
674 'methodname' => 'delete_categories',
675 'classpath' => 'course/externallib.php',
676 'description' => 'Delete course categories',
677 'type' => 'write',
678 'capabilities'=> 'moodle/category:manage',
681 'core_course_import_course' => array(
682 'classname' => 'core_course_external',
683 'methodname' => 'import_course',
684 'classpath' => 'course/externallib.php',
685 'description' => 'Import course data from a course into another course. Does not include any user data.',
686 'type' => 'write',
687 'capabilities'=> 'moodle/backup:backuptargetimport, moodle/restore:restoretargetimport',
690 // === message related functions ===
692 'moodle_message_send_instantmessages' => array(
693 'classname' => 'core_message_external',
694 'methodname' => 'send_instant_messages',
695 'classpath' => 'message/externallib.php',
696 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_message_send_instant_messages()',
697 'type' => 'write',
698 'capabilities'=> 'moodle/site:sendmessage',
701 'core_message_send_instant_messages' => array(
702 'classname' => 'core_message_external',
703 'methodname' => 'send_instant_messages',
704 'classpath' => 'message/externallib.php',
705 'description' => 'Send instant messages',
706 'type' => 'write',
707 'capabilities'=> 'moodle/site:sendmessage',
710 'core_message_create_contacts' => array(
711 'classname' => 'core_message_external',
712 'methodname' => 'create_contacts',
713 'classpath' => 'message/externallib.php',
714 'description' => 'Add contacts to the contact list',
715 'type' => 'write',
716 'capabilities'=> '',
719 'core_message_delete_contacts' => array(
720 'classname' => 'core_message_external',
721 'methodname' => 'delete_contacts',
722 'classpath' => 'message/externallib.php',
723 'description' => 'Remove contacts from the contact list',
724 'type' => 'write',
725 'capabilities'=> '',
728 'core_message_block_contacts' => array(
729 'classname' => 'core_message_external',
730 'methodname' => 'block_contacts',
731 'classpath' => 'message/externallib.php',
732 'description' => 'Block contacts',
733 'type' => 'write',
734 'capabilities'=> '',
737 'core_message_unblock_contacts' => array(
738 'classname' => 'core_message_external',
739 'methodname' => 'unblock_contacts',
740 'classpath' => 'message/externallib.php',
741 'description' => 'Unblock contacts',
742 'type' => 'write',
743 'capabilities'=> '',
746 'core_message_get_contacts' => array(
747 'classname' => 'core_message_external',
748 'methodname' => 'get_contacts',
749 'classpath' => 'message/externallib.php',
750 'description' => 'Retrieve the contact list',
751 'type' => 'read',
752 'capabilities'=> '',
755 'core_message_search_contacts' => array(
756 'classname' => 'core_message_external',
757 'methodname' => 'search_contacts',
758 'classpath' => 'message/externallib.php',
759 'description' => 'Search for contacts',
760 'type' => 'read',
761 'capabilities'=> '',
764 'core_message_get_messages' => array(
765 'classname' => 'core_message_external',
766 'methodname' => 'get_messages',
767 'classpath' => 'message/externallib.php',
768 'description' => 'Retrieve a list of messages sent and received by a user (conversations, notifications or both)',
769 'type' => 'read',
770 'capabilities' => '',
773 // === notes related functions ===
775 'moodle_notes_create_notes' => array(
776 'classname' => 'core_notes_external',
777 'methodname' => 'create_notes',
778 'classpath' => 'notes/externallib.php',
779 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_notes_create_notes()',
780 'type' => 'write',
781 'capabilities'=> 'moodle/notes:manage',
784 'core_notes_create_notes' => array(
785 'classname' => 'core_notes_external',
786 'methodname' => 'create_notes',
787 'classpath' => 'notes/externallib.php',
788 'description' => 'Create notes',
789 'type' => 'write',
790 'capabilities'=> 'moodle/notes:manage',
793 'core_notes_delete_notes' => array(
794 'classname' => 'core_notes_external',
795 'methodname' => 'delete_notes',
796 'classpath' => 'notes/externallib.php',
797 'description' => 'Delete notes',
798 'type' => 'write',
799 'capabilities'=> 'moodle/notes:manage',
802 'core_notes_get_notes' => array(
803 'classname' => 'core_notes_external',
804 'methodname' => 'get_notes',
805 'classpath' => 'notes/externallib.php',
806 'description' => 'Get notes',
807 'type' => 'read',
808 'capabilities'=> 'moodle/notes:view',
811 'core_notes_update_notes' => array(
812 'classname' => 'core_notes_external',
813 'methodname' => 'update_notes',
814 'classpath' => 'notes/externallib.php',
815 'description' => 'Update notes',
816 'type' => 'write',
817 'capabilities'=> 'moodle/notes:manage',
820 // === grading related functions ===
822 'core_grading_get_definitions' => array(
823 'classname' => 'core_grading_external',
824 'methodname' => 'get_definitions',
825 'description' => 'Get grading definitions',
826 'type' => 'read'
829 'core_grade_get_definitions' => array(
830 'classname' => 'core_grade_external',
831 'methodname' => 'get_definitions',
832 'classpath' => 'grade/externallib.php',
833 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has been renamed as core_grading_get_definitions()',
834 'type' => 'read'
837 'core_grading_save_definitions' => array(
838 'classname' => 'core_grading_external',
839 'methodname' => 'save_definitions',
840 'description' => 'Save grading definitions',
841 'type' => 'write'
844 'core_grading_get_gradingform_instances' => array(
845 'classname' => 'core_grading_external',
846 'methodname' => 'get_gradingform_instances',
847 'description' => 'Get grading form instances',
848 'type' => 'read'
851 // === webservice related functions ===
853 'moodle_webservice_get_siteinfo' => array(
854 'classname' => 'core_webservice_external',
855 'methodname' => 'get_site_info',
856 'classpath' => 'webservice/externallib.php',
857 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_webservice_get_site_info()',
858 'type' => 'read',
861 'core_webservice_get_site_info' => array(
862 'classname' => 'core_webservice_external',
863 'methodname' => 'get_site_info',
864 'classpath' => 'webservice/externallib.php',
865 'description' => 'Return some site info / user info / list web service functions',
866 'type' => 'read',
869 'core_get_string' => array(
870 'classname' => 'core_external',
871 'methodname' => 'get_string',
872 'classpath' => 'lib/external/externallib.php',
873 'description' => 'Return a translated string - similar to core get_string() call',
874 'type' => 'read',
877 'core_get_strings' => array(
878 'classname' => 'core_external',
879 'methodname' => 'get_strings',
880 'classpath' => 'lib/external/externallib.php',
881 'description' => 'Return some translated strings - like several core get_string() calls',
882 'type' => 'read',
885 'core_get_component_strings' => array(
886 'classname' => 'core_external',
887 'methodname' => 'get_component_strings',
888 'classpath' => 'lib/external/externallib.php',
889 'description' => 'Return all raw strings (with {$a->xxx}) for a specific component
890 - similar to core get_component_strings() call',
891 'type' => 'read',
895 // === Calendar related functions ===
897 'core_calendar_delete_calendar_events' => array(
898 'classname' => 'core_calendar_external',
899 'methodname' => 'delete_calendar_events',
900 'description' => 'Delete calendar events',
901 'classpath' => 'calendar/externallib.php',
902 'type' => 'write',
903 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
907 'core_calendar_get_calendar_events' => array(
908 'classname' => 'core_calendar_external',
909 'methodname' => 'get_calendar_events',
910 'description' => 'Get calendar events',
911 'classpath' => 'calendar/externallib.php',
912 'type' => 'read',
913 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
916 'core_calendar_create_calendar_events' => array(
917 'classname' => 'core_calendar_external',
918 'methodname' => 'create_calendar_events',
919 'description' => 'Create calendar events',
920 'classpath' => 'calendar/externallib.php',
921 'type' => 'write',
922 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries'
926 $services = array(
927 'Moodle mobile web service' => array(
928 'functions' => array (
929 'moodle_enrol_get_users_courses',
930 'moodle_enrol_get_enrolled_users',
931 'moodle_user_get_users_by_id',
932 'moodle_webservice_get_siteinfo',
933 'moodle_notes_create_notes',
934 'moodle_user_get_course_participants_by_id',
935 'moodle_user_get_users_by_courseid',
936 'moodle_message_send_instantmessages',
937 'core_course_get_contents',
938 'core_get_component_strings',
939 'core_user_add_user_device',
940 'core_calendar_get_calendar_events',
941 'core_enrol_get_users_courses',
942 'core_enrol_get_enrolled_users',
943 'core_user_get_users_by_id',
944 'core_webservice_get_site_info',
945 'core_notes_create_notes',
946 'core_user_get_course_user_profiles',
947 'core_enrol_get_enrolled_users',
948 'core_message_send_instant_messages',
949 'mod_assign_get_grades',
950 'mod_assign_get_assignments',
951 'mod_assign_get_submissions',
952 'mod_assign_get_user_flags',
953 'mod_assign_set_user_flags',
954 'mod_assign_get_user_mappings',
955 'mod_assign_revert_submissions_to_draft',
956 'mod_assign_lock_submissions',
957 'mod_assign_unlock_submissions',
958 'mod_assign_save_submission',
959 'mod_assign_submit_for_grading',
960 'mod_assign_save_grade',
961 'mod_assign_save_user_extensions',
962 'mod_assign_reveal_identities',
963 'message_airnotifier_is_system_configured',
964 'message_airnotifier_are_notification_preferences_configured',
965 'core_grades_get_grades',
966 'core_grades_update_grades',
967 'mod_forum_get_forums_by_courses',
968 'mod_forum_get_forum_discussions_paginated',
969 'mod_forum_get_forum_discussion_posts',
970 'core_files_get_files',
971 'core_message_get_messages'),
972 'enabled' => 0,
973 'restrictedusers' => 0,
974 'shortname' => MOODLE_OFFICIAL_MOBILE_SERVICE,
975 'downloadfiles' => 1,
976 'uploadfiles' => 1