on-demand release 3.1dev+
[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(
f23e9b6b
CB
37 'core_badges_get_user_badges' => array(
38 'classname' => 'core_badges_external',
39 'methodname' => 'get_user_badges',
40 'description' => 'Returns the list of badges awarded to a user.',
41 'type' => 'read',
42 'capabilities' => 'moodle/badges:viewotherbadges'
088645e2 43 ),
f23e9b6b
CB
44 'core_calendar_create_calendar_events' => array(
45 'classname' => 'core_calendar_external',
46 'methodname' => 'create_calendar_events',
47 'description' => 'Create calendar events',
48 'classpath' => 'calendar/externallib.php',
49 'type' => 'write',
50 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries'
088645e2 51 ),
f23e9b6b
CB
52 'core_calendar_delete_calendar_events' => array(
53 'classname' => 'core_calendar_external',
54 'methodname' => 'delete_calendar_events',
55 'description' => 'Delete calendar events',
56 'classpath' => 'calendar/externallib.php',
57 'type' => 'write',
58 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries'
088645e2 59 ),
f23e9b6b
CB
60 'core_calendar_get_calendar_events' => array(
61 'classname' => 'core_calendar_external',
62 'methodname' => 'get_calendar_events',
63 'description' => 'Get calendar events',
64 'classpath' => 'calendar/externallib.php',
65 'type' => 'read',
66 'capabilities' => 'moodle/calendar:manageentries, moodle/calendar:manageownentries, moodle/calendar:managegroupentries'
088645e2 67 ),
088645e2 68 'core_cohort_add_cohort_members' => array(
f23e9b6b
CB
69 'classname' => 'core_cohort_external',
70 'methodname' => 'add_cohort_members',
71 'classpath' => 'cohort/externallib.php',
088645e2 72 'description' => 'Adds cohort members.',
f23e9b6b
CB
73 'type' => 'write',
74 'capabilities' => 'moodle/cohort:assign'
75 ),
76 'core_cohort_create_cohorts' => array(
77 'classname' => 'core_cohort_external',
78 'methodname' => 'create_cohorts',
79 'classpath' => 'cohort/externallib.php',
80 'description' => 'Creates new cohorts.',
81 'type' => 'write',
82 'capabilities' => 'moodle/cohort:manage'
088645e2 83 ),
088645e2 84 'core_cohort_delete_cohort_members' => array(
f23e9b6b
CB
85 'classname' => 'core_cohort_external',
86 'methodname' => 'delete_cohort_members',
87 'classpath' => 'cohort/externallib.php',
088645e2 88 'description' => 'Deletes cohort members.',
f23e9b6b
CB
89 'type' => 'delete',
90 'capabilities' => 'moodle/cohort:assign'
91 ),
92 'core_cohort_delete_cohorts' => array(
93 'classname' => 'core_cohort_external',
94 'methodname' => 'delete_cohorts',
95 'classpath' => 'cohort/externallib.php',
96 'description' => 'Deletes all specified cohorts.',
97 'type' => 'delete',
98 'capabilities' => 'moodle/cohort:manage'
088645e2 99 ),
088645e2 100 'core_cohort_get_cohort_members' => array(
f23e9b6b
CB
101 'classname' => 'core_cohort_external',
102 'methodname' => 'get_cohort_members',
103 'classpath' => 'cohort/externallib.php',
088645e2 104 'description' => 'Returns cohort members.',
f23e9b6b
CB
105 'type' => 'read',
106 'capabilities' => 'moodle/cohort:view'
e77a0f36 107 ),
f23e9b6b
CB
108 'core_cohort_get_cohorts' => array(
109 'classname' => 'core_cohort_external',
110 'methodname' => 'get_cohorts',
111 'classpath' => 'cohort/externallib.php',
112 'description' => 'Returns cohort details.',
113 'type' => 'read',
114 'capabilities' => 'moodle/cohort:view'
d3549931 115 ),
f23e9b6b
CB
116 'core_cohort_update_cohorts' => array(
117 'classname' => 'core_cohort_external',
118 'methodname' => 'update_cohorts',
119 'classpath' => 'cohort/externallib.php',
120 'description' => 'Updates existing cohorts.',
121 'type' => 'write',
122 'capabilities' => 'moodle/cohort:manage'
d3549931 123 ),
f23e9b6b
CB
124 'core_comment_get_comments' => array(
125 'classname' => 'core_comment_external',
126 'methodname' => 'get_comments',
127 'description' => 'Returns comments.',
128 'type' => 'read',
129 'capabilities' => 'moodle/comment:view'
5d1017e1 130 ),
f23e9b6b
CB
131 'core_completion_get_activities_completion_status' => array(
132 'classname' => 'core_completion_external',
133 'methodname' => 'get_activities_completion_status',
134 'description' => 'Return the activities completion status for a user in a course.',
135 'type' => 'read',
9a0df45a 136 ),
f23e9b6b
CB
137 'core_completion_get_course_completion_status' => array(
138 'classname' => 'core_completion_external',
139 'methodname' => 'get_course_completion_status',
140 'description' => 'Returns course completion status.',
141 'type' => 'read',
142 'capabilities' => 'report/completion:view'
5d1017e1 143 ),
f23e9b6b
CB
144 'core_completion_mark_course_self_completed' => array(
145 'classname' => 'core_completion_external',
146 'methodname' => 'mark_course_self_completed',
147 'description' => 'Update the course completion status for the current user (if course self-completion is enabled).',
148 'type' => 'write',
9a0df45a 149 ),
f23e9b6b
CB
150 'core_completion_update_activity_completion_status_manually' => array(
151 'classname' => 'core_completion_external',
152 'methodname' => 'update_activity_completion_status_manually',
153 'description' => 'Update completion status for the current user in an activity, only for activities with manual tracking.',
154 'type' => 'write',
5d1017e1 155 ),
f23e9b6b
CB
156 'core_course_create_categories' => array(
157 'classname' => 'core_course_external',
158 'methodname' => 'create_categories',
159 'classpath' => 'course/externallib.php',
160 'description' => 'Create course categories',
161 'type' => 'write',
162 'capabilities' => 'moodle/category:manage'
246f6da2 163 ),
f23e9b6b
CB
164 'core_course_create_courses' => array(
165 'classname' => 'core_course_external',
166 'methodname' => 'create_courses',
167 'classpath' => 'course/externallib.php',
168 'description' => 'Create new courses',
169 'type' => 'write',
170 'capabilities' => 'moodle/course:create, moodle/course:visibility'
5d1017e1 171 ),
f23e9b6b
CB
172 'core_course_delete_categories' => array(
173 'classname' => 'core_course_external',
174 'methodname' => 'delete_categories',
175 'classpath' => 'course/externallib.php',
176 'description' => 'Delete course categories',
177 'type' => 'write',
178 'capabilities' => 'moodle/category:manage'
9a0df45a 179 ),
f23e9b6b
CB
180 'core_course_delete_courses' => array(
181 'classname' => 'core_course_external',
182 'methodname' => 'delete_courses',
183 'classpath' => 'course/externallib.php',
184 'description' => 'Deletes all specified courses',
185 'type' => 'write',
186 'capabilities' => 'moodle/course:delete'
5d1017e1 187 ),
f23e9b6b
CB
188 'core_course_delete_modules' => array(
189 'classname' => 'core_course_external',
190 'methodname' => 'delete_modules',
191 'classpath' => 'course/externallib.php',
192 'description' => 'Deletes all specified module instances',
193 'type' => 'write',
194 'capabilities' => 'moodle/course:manageactivities'
9a0df45a 195 ),
f23e9b6b
CB
196 'core_course_duplicate_course' => array(
197 'classname' => 'core_course_external',
198 'methodname' => 'duplicate_course',
199 'classpath' => 'course/externallib.php',
200 'description' => 'Duplicate an existing course (creating a new one), without user data',
201 'type' => 'write',
202 'capabilities' => 'moodle/backup:backupcourse, moodle/restore:restorecourse, moodle/course:create'
5d1017e1 203 ),
f23e9b6b
CB
204 'core_course_get_categories' => array(
205 'classname' => 'core_course_external',
206 'methodname' => 'get_categories',
207 'classpath' => 'course/externallib.php',
208 'description' => 'Return category details',
209 'type' => 'read',
210 'capabilities' => 'moodle/category:viewhiddencategories'
9a0df45a 211 ),
f23e9b6b
CB
212 'core_course_get_contents' => array(
213 'classname' => 'core_course_external',
214 'methodname' => 'get_course_contents',
215 'classpath' => 'course/externallib.php',
216 'description' => 'Get course contents',
217 'type' => 'read',
218 'capabilities' => 'moodle/course:update, moodle/course:viewhiddencourses'
9a0df45a 219 ),
f23e9b6b
CB
220 'core_course_get_course_module' => array(
221 'classname' => 'core_course_external',
222 'methodname' => 'get_course_module',
223 'classpath' => 'course/externallib.php',
224 'description' => 'Return information about a course module',
225 'type' => 'read',
5d1017e1 226 ),
f23e9b6b
CB
227 'core_course_get_course_module_by_instance' => array(
228 'classname' => 'core_course_external',
229 'methodname' => 'get_course_module_by_instance',
230 'classpath' => 'course/externallib.php',
231 'description' => 'Return information about a given module name and instance id',
232 'type' => 'read',
7ce23590 233 ),
f23e9b6b
CB
234 'core_course_get_courses' => array(
235 'classname' => 'core_course_external',
236 'methodname' => 'get_courses',
237 'classpath' => 'course/externallib.php',
238 'description' => 'Return course details',
239 'type' => 'read',
240 'capabilities' => 'moodle/course:view, moodle/course:update, moodle/course:viewhiddencourses',
241 'ajax' => '1',
7ce23590 242 ),
f23e9b6b
CB
243 'core_course_import_course' => array(
244 'classname' => 'core_course_external',
245 'methodname' => 'import_course',
246 'classpath' => 'course/externallib.php',
247 'description' => 'Import course data from a course into another course. Does not include any user data.',
248 'type' => 'write',
249 'capabilities' => 'moodle/backup:backuptargetimport, moodle/restore:restoretargetimport'
7ce23590 250 ),
f23e9b6b
CB
251 'core_course_search_courses' => array(
252 'classname' => 'core_course_external',
253 'methodname' => 'search_courses',
254 'classpath' => 'course/externallib.php',
255 'description' => 'Search courses by (name, module, block, tag)',
256 'type' => 'read',
257 'ajax' => '1',
7ce23590 258 ),
f23e9b6b
CB
259 'core_course_update_categories' => array(
260 'classname' => 'core_course_external',
261 'methodname' => 'update_categories',
262 'classpath' => 'course/externallib.php',
263 'description' => 'Update categories',
264 'type' => 'write',
265 'capabilities' => 'moodle/category:manage',
7ce23590 266 ),
f23e9b6b
CB
267 'core_course_update_courses' => array(
268 'classname' => 'core_course_external',
269 'methodname' => 'update_courses',
270 'classpath' => 'course/externallib.php',
271 'description' => 'Update courses',
272 'type' => 'write',
273 'capabilities' => 'moodle/course:update, moodle/course:changecategory, moodle/course:changefullname, '
274 . 'moodle/course:changeshortname, moodle/course:changeidnumber, moodle/course:changesummary, moodle/course:visibility'
7ce23590 275 ),
f23e9b6b
CB
276 'core_course_view_course' => array(
277 'classname' => 'core_course_external',
278 'methodname' => 'view_course',
279 'classpath' => 'course/externallib.php',
280 'description' => 'Log that the course was viewed',
281 'type' => 'write',
7ce23590 282 ),
f23e9b6b
CB
283 'core_enrol_get_course_enrolment_methods' => array(
284 'classname' => 'core_enrol_external',
285 'methodname' => 'get_course_enrolment_methods',
286 'classpath' => 'enrol/externallib.php',
287 'description' => 'Get the list of course enrolment methods',
288 'type' => 'read',
5d62e813 289 ),
f23e9b6b
CB
290 'core_enrol_get_enrolled_users' => array(
291 'classname' => 'core_enrol_external',
292 'methodname' => 'get_enrolled_users',
293 'classpath' => 'enrol/externallib.php',
294 'description' => 'Get enrolled users by course id.',
295 'type' => 'read',
296 'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, '
297 . 'moodle/site:accessallgroups'
7107c2f0 298 ),
f23e9b6b
CB
299 'core_enrol_get_enrolled_users_with_capability' => array(
300 'classname' => 'core_enrol_external',
301 'methodname' => 'get_enrolled_users_with_capability',
302 'classpath' => 'enrol/externallib.php',
303 'description' => 'For each course and capability specified, return a list of the users that are enrolled in the course
304 and have that capability',
305 'type' => 'read',
c0ef63eb 306 ),
f23e9b6b
CB
307 'core_enrol_get_users_courses' => array(
308 'classname' => 'core_enrol_external',
309 'methodname' => 'get_users_courses',
310 'classpath' => 'enrol/externallib.php',
311 'description' => 'Get the list of courses where a user is enrolled in',
312 'type' => 'read',
313 'capabilities' => 'moodle/course:viewparticipants'
9857381d 314 ),
f23e9b6b
CB
315 'core_fetch_notifications' => array(
316 'classname' => 'core_external',
317 'methodname' => 'fetch_notifications',
318 'classpath' => 'lib/external/externallib.php',
319 'description' => 'Return a list of notifications for the current session',
320 'type' => 'read',
321 'loginrequired' => '',
322 'ajax' => '1',
5d1017e1 323 ),
5d1017e1 324 'core_files_get_files' => array(
f23e9b6b
CB
325 'classname' => 'core_files_external',
326 'methodname' => 'get_files',
249c4f60 327 'description' => 'browse moodle files',
f23e9b6b
CB
328 'type' => 'read',
329 'classpath' => 'files/externallib.php',
5d1017e1 330 ),
5d1017e1 331 'core_files_upload' => array(
f23e9b6b
CB
332 'classname' => 'core_files_external',
333 'methodname' => 'upload',
249c4f60
DC
334 'description' => 'upload a file to moodle',
335 'type' => 'write',
336 'classpath' => 'files/externallib.php',
337 ),
f23e9b6b
CB
338 'core_get_component_strings' => array(
339 'classname' => 'core_external',
340 'methodname' => 'get_component_strings',
341 'classpath' => 'lib/external/externallib.php',
faeca20d
DM
342 'description' => 'Return all raw strings (with {$a->xxx}), for a specific component ' .
343 '- similar to core get_component_strings(), call',
f23e9b6b
CB
344 'type' => 'read',
345 'loginrequired' => '',
346 'ajax' => '1',
3364dbb5 347 ),
f23e9b6b
CB
348 'core_get_fragment' => array(
349 'classname' => 'core_external',
350 'methodname' => 'get_fragment',
351 'classpath' => 'lib/external/externallib.php',
352 'description' => 'Return a fragment for inclusion, such as a JavaScript page.',
353 'type' => 'read',
354 'ajax' => '1',
5d1017e1 355 ),
f23e9b6b
CB
356 'core_get_string' => array(
357 'classname' => 'core_external',
358 'methodname' => 'get_string',
359 'classpath' => 'lib/external/externallib.php',
360 'description' => 'Return a translated string - similar to core get_string(), call',
361 'type' => 'read',
362 'loginrequired' => '',
363 'ajax' => '1',
be9bf94e 364 ),
f23e9b6b
CB
365 'core_get_strings' => array(
366 'classname' => 'core_external',
367 'methodname' => 'get_strings',
368 'classpath' => 'lib/external/externallib.php',
369 'description' => 'Return some translated strings - like several core get_string(), calls',
370 'type' => 'read',
371 'loginrequired' => '',
372 'ajax' => '1',
5d1017e1 373 ),
f23e9b6b
CB
374 'core_grades_get_grades' => array(
375 'classname' => 'core_grades_external',
376 'methodname' => 'get_grades',
377 'description' => 'Returns student course total grade and grades for activities.
378 This function does not return category or manual items.
379 This function is suitable for managers or teachers not students.',
380 'type' => 'read',
381 'capabilities' => 'moodle/grade:view, moodle/grade:viewall, moodle/grade:viewhidden'
e9b66095 382 ),
f23e9b6b
CB
383 'core_grades_update_grades' => array(
384 'classname' => 'core_grades_external',
385 'methodname' => 'update_grades',
386 'description' => 'Update a grade item and associated student grades.',
387 'type' => 'write',
5d1017e1 388 ),
f23e9b6b
CB
389 'core_grading_get_definitions' => array(
390 'classname' => 'core_grading_external',
391 'methodname' => 'get_definitions',
392 'description' => 'Get grading definitions',
393 'type' => 'read',
e9b66095 394 ),
f23e9b6b
CB
395 'core_grading_get_gradingform_instances' => array(
396 'classname' => 'core_grading_external',
397 'methodname' => 'get_gradingform_instances',
398 'description' => 'Get grading form instances',
399 'type' => 'read',
f2229c68 400 ),
f23e9b6b
CB
401 'core_grading_save_definitions' => array(
402 'classname' => 'core_grading_external',
403 'methodname' => 'save_definitions',
404 'description' => 'Save grading definitions',
405 'type' => 'write',
5d1017e1 406 ),
f23e9b6b
CB
407 'core_group_add_group_members' => array(
408 'classname' => 'core_group_external',
409 'methodname' => 'add_group_members',
410 'classpath' => 'group/externallib.php',
411 'description' => 'Adds group members.',
412 'type' => 'write',
413 'capabilities' => 'moodle/course:managegroups',
6bb31e40 414 ),
f23e9b6b
CB
415 'core_group_assign_grouping' => array(
416 'classname' => 'core_group_external',
417 'methodname' => 'assign_grouping',
418 'classpath' => 'group/externallib.php',
419 'description' => 'Assing groups from groupings',
420 'type' => 'write',
740c354f 421 ),
f23e9b6b
CB
422 'core_group_create_groupings' => array(
423 'classname' => 'core_group_external',
424 'methodname' => 'create_groupings',
425 'classpath' => 'group/externallib.php',
426 'description' => 'Creates new groupings',
427 'type' => 'write',
5d1017e1 428 ),
f23e9b6b
CB
429 'core_group_create_groups' => array(
430 'classname' => 'core_group_external',
431 'methodname' => 'create_groups',
432 'classpath' => 'group/externallib.php',
433 'description' => 'Creates new groups.',
434 'type' => 'write',
435 'capabilities' => 'moodle/course:managegroups'
6bb31e40 436 ),
f23e9b6b
CB
437 'core_group_delete_group_members' => array(
438 'classname' => 'core_group_external',
439 'methodname' => 'delete_group_members',
440 'classpath' => 'group/externallib.php',
441 'description' => 'Deletes group members.',
442 'type' => 'delete',
443 'capabilities' => 'moodle/course:managegroups'
63a85dc7 444 ),
f23e9b6b
CB
445 'core_group_delete_groupings' => array(
446 'classname' => 'core_group_external',
447 'methodname' => 'delete_groupings',
448 'classpath' => 'group/externallib.php',
449 'description' => 'Deletes all specified groupings.',
79949c1b 450 'type' => 'write',
79949c1b 451 ),
f23e9b6b
CB
452 'core_group_delete_groups' => array(
453 'classname' => 'core_group_external',
454 'methodname' => 'delete_groups',
455 'classpath' => 'group/externallib.php',
456 'description' => 'Deletes all specified groups.',
457 'type' => 'delete',
458 'capabilities' => 'moodle/course:managegroups'
3dc1d76e 459 ),
f23e9b6b
CB
460 'core_group_get_activity_allowed_groups' => array(
461 'classname' => 'core_group_external',
462 'methodname' => 'get_activity_allowed_groups',
463 'classpath' => 'group/externallib.php',
464 'description' => 'Gets a list of groups that the user is allowed to access within the specified activity.',
465 'type' => 'read',
791723c3 466 ),
f23e9b6b
CB
467 'core_group_get_activity_groupmode' => array(
468 'classname' => 'core_group_external',
469 'methodname' => 'get_activity_groupmode',
470 'classpath' => 'group/externallib.php',
471 'description' => 'Returns effective groupmode used in a given activity.',
472 'type' => 'read',
c4f7bf29 473 ),
f23e9b6b
CB
474 'core_group_get_course_groupings' => array(
475 'classname' => 'core_group_external',
476 'methodname' => 'get_course_groupings',
477 'classpath' => 'group/externallib.php',
478 'description' => 'Returns all groupings in specified course.',
479 'type' => 'read',
c5158499 480 ),
f23e9b6b
CB
481 'core_group_get_course_groups' => array(
482 'classname' => 'core_group_external',
483 'methodname' => 'get_course_groups',
484 'classpath' => 'group/externallib.php',
485 'description' => 'Returns all groups in specified course.',
486 'type' => 'read',
487 'capabilities' => 'moodle/course:managegroups'
13bb6819 488 ),
f23e9b6b
CB
489 'core_group_get_course_user_groups' => array(
490 'classname' => 'core_group_external',
491 'methodname' => 'get_course_user_groups',
492 'classpath' => 'group/externallib.php',
493 'description' => 'Returns all groups in specified course for the specified user.',
494 'type' => 'read',
495 'capabilities' => 'moodle/course:managegroups'
3ec163dd 496 ),
f23e9b6b
CB
497 'core_group_get_group_members' => array(
498 'classname' => 'core_group_external',
499 'methodname' => 'get_group_members',
500 'classpath' => 'group/externallib.php',
501 'description' => 'Returns group members.',
502 'type' => 'read',
503 'capabilities' => 'moodle/course:managegroups'
479a5db1 504 ),
f23e9b6b
CB
505 'core_group_get_groupings' => array(
506 'classname' => 'core_group_external',
507 'methodname' => 'get_groupings',
508 'classpath' => 'group/externallib.php',
509 'description' => 'Returns groupings details.',
510 'type' => 'read',
3ec163dd 511 ),
f23e9b6b
CB
512 'core_group_get_groups' => array(
513 'classname' => 'core_group_external',
514 'methodname' => 'get_groups',
515 'classpath' => 'group/externallib.php',
516 'description' => 'Returns group details.',
517 'type' => 'read',
518 'capabilities' => 'moodle/course:managegroups'
2f951d86 519 ),
f23e9b6b
CB
520 'core_group_unassign_grouping' => array(
521 'classname' => 'core_group_external',
522 'methodname' => 'unassign_grouping',
523 'classpath' => 'group/externallib.php',
524 'description' => 'Unassing groups from groupings',
525 'type' => 'write',
8430d87b 526 ),
f23e9b6b
CB
527 'core_group_update_groupings' => array(
528 'classname' => 'core_group_external',
529 'methodname' => 'update_groupings',
530 'classpath' => 'group/externallib.php',
531 'description' => 'Updates existing groupings',
532 'type' => 'write',
5d1017e1 533 ),
f23e9b6b
CB
534 'core_message_block_contacts' => array(
535 'classname' => 'core_message_external',
536 'methodname' => 'block_contacts',
537 'classpath' => 'message/externallib.php',
538 'description' => 'Block contacts',
539 'type' => 'write',
a623b6b8 540 ),
d6731600 541 'core_message_create_contacts' => array(
f23e9b6b
CB
542 'classname' => 'core_message_external',
543 'methodname' => 'create_contacts',
544 'classpath' => 'message/externallib.php',
d6731600 545 'description' => 'Add contacts to the contact list',
f23e9b6b 546 'type' => 'write',
d6731600 547 ),
d6731600 548 'core_message_delete_contacts' => array(
f23e9b6b
CB
549 'classname' => 'core_message_external',
550 'methodname' => 'delete_contacts',
551 'classpath' => 'message/externallib.php',
d6731600 552 'description' => 'Remove contacts from the contact list',
f23e9b6b 553 'type' => 'write',
d6731600 554 ),
f23e9b6b
CB
555 'core_message_delete_message' => array(
556 'classname' => 'core_message_external',
557 'methodname' => 'delete_message',
558 'classpath' => 'message/externallib.php',
559 'description' => 'Deletes a message.',
560 'type' => 'write',
561 'capabilities' => 'moodle/site:deleteownmessage'
d6731600 562 ),
f23e9b6b
CB
563 'core_message_get_blocked_users' => array(
564 'classname' => 'core_message_external',
565 'methodname' => 'get_blocked_users',
566 'classpath' => 'message/externallib.php',
567 'description' => 'Retrieve a list of users blocked',
568 'type' => 'read',
d6731600 569 ),
d6731600 570 'core_message_get_contacts' => array(
f23e9b6b
CB
571 'classname' => 'core_message_external',
572 'methodname' => 'get_contacts',
573 'classpath' => 'message/externallib.php',
d6731600 574 'description' => 'Retrieve the contact list',
f23e9b6b 575 'type' => 'read',
d6731600 576 ),
aff9da17 577 'core_message_get_messages' => array(
f23e9b6b
CB
578 'classname' => 'core_message_external',
579 'methodname' => 'get_messages',
580 'classpath' => 'message/externallib.php',
581 'description' => 'Retrieve a list of messages sent and received by a user (conversations, notifications or both)',
582 'type' => 'read',
60ab2e1b 583 ),
a84f89ca 584 'core_message_mark_message_read' => array(
f23e9b6b
CB
585 'classname' => 'core_message_external',
586 'methodname' => 'mark_message_read',
587 'classpath' => 'message/externallib.php',
588 'description' => 'Mark a single message as read, trigger message_viewed event.',
589 'type' => 'write',
a84f89ca 590 ),
f23e9b6b
CB
591 'core_message_search_contacts' => array(
592 'classname' => 'core_message_external',
593 'methodname' => 'search_contacts',
594 'classpath' => 'message/externallib.php',
595 'description' => 'Search for contacts',
596 'type' => 'read',
419b1128 597 ),
f23e9b6b
CB
598 'core_message_send_instant_messages' => array(
599 'classname' => 'core_message_external',
600 'methodname' => 'send_instant_messages',
601 'classpath' => 'message/externallib.php',
602 'description' => 'Send instant messages',
603 'type' => 'write',
604 'capabilities' => 'moodle/site:sendmessage'
605 ),
606 'core_message_unblock_contacts' => array(
607 'classname' => 'core_message_external',
608 'methodname' => 'unblock_contacts',
609 'classpath' => 'message/externallib.php',
610 'description' => 'Unblock contacts',
611 'type' => 'write',
5d1017e1 612 ),
5d1017e1 613 'core_notes_create_notes' => array(
f23e9b6b
CB
614 'classname' => 'core_notes_external',
615 'methodname' => 'create_notes',
616 'classpath' => 'notes/externallib.php',
8d46dabb 617 'description' => 'Create notes',
f23e9b6b
CB
618 'type' => 'write',
619 'capabilities' => 'moodle/notes:manage'
8d46dabb 620 ),
34348b2b 621 'core_notes_delete_notes' => array(
f23e9b6b
CB
622 'classname' => 'core_notes_external',
623 'methodname' => 'delete_notes',
624 'classpath' => 'notes/externallib.php',
34348b2b 625 'description' => 'Delete notes',
f23e9b6b
CB
626 'type' => 'write',
627 'capabilities' => 'moodle/notes:manage'
628 ),
629 'core_notes_get_course_notes' => array(
630 'classname' => 'core_notes_external',
631 'methodname' => 'get_course_notes',
632 'classpath' => 'notes/externallib.php',
633 'description' => 'Returns all notes in specified course (or site), for the specified user.',
634 'type' => 'read',
635 'capabilities' => 'moodle/notes:view'
34348b2b 636 ),
34348b2b 637 'core_notes_get_notes' => array(
f23e9b6b
CB
638 'classname' => 'core_notes_external',
639 'methodname' => 'get_notes',
640 'classpath' => 'notes/externallib.php',
34348b2b 641 'description' => 'Get notes',
f23e9b6b
CB
642 'type' => 'read',
643 'capabilities' => 'moodle/notes:view'
34348b2b 644 ),
34348b2b 645 'core_notes_update_notes' => array(
f23e9b6b
CB
646 'classname' => 'core_notes_external',
647 'methodname' => 'update_notes',
648 'classpath' => 'notes/externallib.php',
34348b2b 649 'description' => 'Update notes',
f23e9b6b
CB
650 'type' => 'write',
651 'capabilities' => 'moodle/notes:manage'
34348b2b 652 ),
a80b5518 653 'core_notes_view_notes' => array(
f23e9b6b
CB
654 'classname' => 'core_notes_external',
655 'methodname' => 'view_notes',
656 'classpath' => 'notes/externallib.php',
657 'description' => 'Simulates the web interface view of notes/index.php: trigger events.',
658 'type' => 'write',
659 'capabilities' => 'moodle/notes:view'
9028d9b5 660 ),
f23e9b6b
CB
661 'core_output_load_template' => array(
662 'classname' => 'core\output\external',
663 'methodname' => 'load_template',
664 'description' => 'Load a template for a renderable',
665 'type' => 'read',
666 'loginrequired' => '',
667 'ajax' => '1',
0ff4ebb4 668 ),
f23e9b6b
CB
669 // Question related functions.
670 'core_question_update_flag' => array(
671 'classname' => 'core_question_external',
672 'methodname' => 'update_flag',
673 'description' => 'Update the flag state of a question attempt.',
674 'type' => 'write',
675 'capabilities' => 'moodle/question:flag',
3f0ea6d8 676 ),
f23e9b6b
CB
677 'core_rating_get_item_ratings' => array(
678 'classname' => 'core_rating_external',
679 'methodname' => 'get_item_ratings',
680 'description' => 'Retrieve all the ratings for an item.',
681 'type' => 'read',
682 'capabilities' => 'moodle/rating:view'
5d1017e1 683 ),
f23e9b6b
CB
684 'core_role_assign_roles' => array(
685 'classname' => 'core_role_external',
686 'methodname' => 'assign_roles',
687 'classpath' => 'enrol/externallib.php',
688 'description' => 'Manual role assignments.',
689 'type' => 'write',
690 'capabilities' => 'moodle/role:assign'
0bf486a6 691 ),
f23e9b6b
CB
692 'core_role_unassign_roles' => array(
693 'classname' => 'core_role_external',
694 'methodname' => 'unassign_roles',
695 'classpath' => 'enrol/externallib.php',
696 'description' => 'Manual role unassignments.',
697 'type' => 'write',
698 'capabilities' => 'moodle/role:assign'
11e76602 699 ),
f23e9b6b
CB
700 'core_tag_get_tagindex' => array(
701 'classname' => 'core_tag_external',
702 'methodname' => 'get_tagindex',
703 'description' => 'Gets tag index page for one tag and one tag area',
704 'type' => 'read',
705 'ajax' => '1',
11e76602 706 ),
f23e9b6b
CB
707 'core_tag_get_tags' => array(
708 'classname' => 'core_tag_external',
709 'methodname' => 'get_tags',
710 'description' => 'Gets tags by their ids',
711 'type' => 'read',
712 'ajax' => '1',
11e76602 713 ),
f23e9b6b
CB
714 'core_tag_update_tags' => array(
715 'classname' => 'core_tag_external',
716 'methodname' => 'update_tags',
717 'description' => 'Updates tags',
718 'type' => 'write',
719 'ajax' => '1',
cc73ea07 720 ),
cdc5f978 721 'core_update_inplace_editable' => array(
f23e9b6b
CB
722 'classname' => 'core_external',
723 'methodname' => 'update_inplace_editable',
724 'classpath' => 'lib/external/externallib.php',
cdc5f978 725 'description' => 'Generic service to update title',
f23e9b6b
CB
726 'type' => 'write',
727 'loginrequired' => '1',
728 'ajax' => '1',
c66dc3df 729 ),
f23e9b6b
CB
730 'core_user_add_user_device' => array(
731 'classname' => 'core_user_external',
732 'methodname' => 'add_user_device',
733 'classpath' => 'user/externallib.php',
734 'description' => 'Store mobile user devices information for PUSH Notifications.',
735 'type' => 'write',
9bdcf579 736 ),
f23e9b6b
CB
737 'core_user_add_user_private_files' => array(
738 'classname' => 'core_user_external',
739 'methodname' => 'add_user_private_files',
740 'classpath' => 'user/externallib.php',
741 'description' => 'Copy files from a draft area to users private files area.',
742 'type' => 'write',
743 'capabilities' => 'moodle/user:manageownfiles'
25c49a85 744 ),
f23e9b6b
CB
745 'core_user_create_users' => array(
746 'classname' => 'core_user_external',
747 'methodname' => 'create_users',
748 'classpath' => 'user/externallib.php',
749 'description' => 'Create users.',
750 'type' => 'write',
751 'capabilities' => 'moodle/user:create'
23b398fc 752 ),
f23e9b6b
CB
753 'core_user_delete_users' => array(
754 'classname' => 'core_user_external',
755 'methodname' => 'delete_users',
756 'classpath' => 'user/externallib.php',
757 'description' => 'Delete users.',
758 'type' => 'write',
759 'capabilities' => 'moodle/user:delete'
6c785afa 760 ),
f23e9b6b
CB
761 'core_user_get_course_user_profiles' => array(
762 'classname' => 'core_user_external',
763 'methodname' => 'get_course_user_profiles',
764 'classpath' => 'user/externallib.php',
765 'description' => 'Get course user profiles (each of the profils matching a course id and a user id),.',
766 'type' => 'read',
767 'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, '
768 . 'moodle/site:accessallgroups'
6c785afa 769 ),
f23e9b6b
CB
770 'core_user_get_users' => array(
771 'classname' => 'core_user_external',
772 'methodname' => 'get_users',
773 'classpath' => 'user/externallib.php',
774 'description' => 'search for users matching the parameters',
775 'type' => 'read',
776 'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update'
db5b6971 777 ),
f23e9b6b
CB
778 'core_user_get_users_by_field' => array(
779 'classname' => 'core_user_external',
780 'methodname' => 'get_users_by_field',
781 'classpath' => 'user/externallib.php',
782 'description' => 'Retrieve users\' information for a specified unique field - If you want to do a user search, use '
783 . 'core_user_get_users()',
784 'type' => 'read',
785 'capabilities' => 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update'
8e355853 786 ),
f23e9b6b
CB
787 'core_user_remove_user_device' => array(
788 'classname' => 'core_user_external',
789 'methodname' => 'remove_user_device',
790 'classpath' => 'user/externallib.php',
791 'description' => 'Remove a user device from the Moodle database.',
792 'type' => 'write',
ef4c23cc 793 ),
f23e9b6b
CB
794 'core_user_update_users' => array(
795 'classname' => 'core_user_external',
796 'methodname' => 'update_users',
797 'classpath' => 'user/externallib.php',
798 'description' => 'Update users.',
799 'type' => 'write',
800 'capabilities' => 'moodle/user:update',
c026a28d 801 ),
f23e9b6b
CB
802 'core_user_view_user_list' => array(
803 'classname' => 'core_user_external',
804 'methodname' => 'view_user_list',
805 'classpath' => 'user/externallib.php',
806 'description' => 'Simulates the web-interface view of user/index.php (triggering events),.',
807 'type' => 'write',
808 'capabilities' => 'moodle/course:viewparticipants',
7361b968 809 ),
f23e9b6b
CB
810 'core_user_view_user_profile' => array(
811 'classname' => 'core_user_external',
812 'methodname' => 'view_user_profile',
813 'classpath' => 'user/externallib.php',
814 'description' => 'Simulates the web-interface view of user/view.php and user/profile.php (triggering events),.',
815 'type' => 'write',
816 'capabilities' => 'moodle/user:viewdetails',
f4fb827e
JL
817 ),
818
81de839f
FM
819 // Competencies functions.
820 'core_competency_create_competency_framework' => array(
821 'classname' => 'core_competency\external',
822 'methodname' => 'create_competency_framework',
823 'classpath' => '',
824 'description' => 'Creates new competency frameworks.',
825 'type' => 'write',
826 'capabilities' => 'moodle/competency:competencymanage',
827 'ajax' => true,
828 ),
829 'core_competency_read_competency_framework' => array(
830 'classname' => 'core_competency\external',
831 'methodname' => 'read_competency_framework',
832 'classpath' => '',
833 'description' => 'Load a summary of a competency framework.',
834 'type' => 'read',
835 'capabilities' => 'moodle/competency:competencyview',
836 'ajax' => true,
837 ),
838 'core_competency_duplicate_competency_framework' => array(
839 'classname' => 'core_competency\external',
840 'methodname' => 'duplicate_competency_framework',
841 'classpath' => '',
842 'description' => 'Duplicate a competency framework.',
843 'type' => 'write',
844 'capabilities' => 'moodle/competency:competencymanage',
845 'ajax' => true,
846 ),
847 'core_competency_delete_competency_framework' => array(
848 'classname' => 'core_competency\external',
849 'methodname' => 'delete_competency_framework',
850 'classpath' => '',
851 'description' => 'Delete a competency framework.',
852 'type' => 'write',
853 'capabilities' => 'moodle/competency:competencymanage',
854 'ajax' => true,
855 ),
856 'core_competency_update_competency_framework' => array(
857 'classname' => 'core_competency\external',
858 'methodname' => 'update_competency_framework',
859 'classpath' => '',
860 'description' => 'Update a competency framework.',
861 'type' => 'write',
862 'capabilities' => 'moodle/competency:competencymanage',
863 'ajax' => true,
864 ),
865 'core_competency_list_competency_frameworks' => array(
866 'classname' => 'core_competency\external',
867 'methodname' => 'list_competency_frameworks',
868 'classpath' => '',
869 'description' => 'Load a list of a competency frameworks.',
870 'type' => 'read',
871 'capabilities' => 'moodle/competency:competencyview',
872 'ajax' => true,
873 ),
874 'core_competency_count_competency_frameworks' => array(
875 'classname' => 'core_competency\external',
876 'methodname' => 'count_competency_frameworks',
877 'classpath' => '',
878 'description' => 'Count a list of a competency frameworks.',
879 'type' => 'read',
880 'capabilities' => 'moodle/competency:competencyview',
881 'ajax' => true,
882 ),
883 'core_competency_competency_framework_viewed' => array(
884 'classname' => 'core_competency\external',
885 'methodname' => 'competency_framework_viewed',
886 'classpath' => '',
887 'description' => 'Log event competency framework viewed',
888 'type' => 'read',
889 'capabilities' => 'moodle/competency:competencyview',
890 'ajax' => true,
891 ),
892 'core_competency_create_competency' => array(
893 'classname' => 'core_competency\external',
894 'methodname' => 'create_competency',
895 'classpath' => '',
896 'description' => 'Creates new competencies.',
897 'type' => 'write',
898 'capabilities' => 'moodle/competency:competencymanage',
899 'ajax' => true,
900 ),
901 'core_competency_read_competency' => array(
902 'classname' => 'core_competency\external',
903 'methodname' => 'read_competency',
904 'classpath' => '',
905 'description' => 'Load a summary of a competency.',
906 'type' => 'read',
907 'capabilities' => 'moodle/competency:competencyview',
908 'ajax' => true,
909 ),
910 'core_competency_competency_viewed' => array(
911 'classname' => 'core_competency\external',
912 'methodname' => 'competency_viewed',
913 'classpath' => '',
914 'description' => 'Log event competency viewed',
915 'type' => 'read',
916 'capabilities' => 'moodle/competency:competencyview',
917 'ajax' => true,
918 ),
919 'core_competency_delete_competency' => array(
920 'classname' => 'core_competency\external',
921 'methodname' => 'delete_competency',
922 'classpath' => '',
923 'description' => 'Delete a competency.',
924 'type' => 'write',
925 'capabilities' => 'moodle/competency:competencymanage',
926 'ajax' => true,
927 ),
928 'core_competency_update_competency' => array(
929 'classname' => 'core_competency\external',
930 'methodname' => 'update_competency',
931 'classpath' => '',
932 'description' => 'Update a competency.',
933 'type' => 'write',
934 'capabilities' => 'moodle/competency:competencymanage',
935 'ajax' => true,
936 ),
937 'core_competency_list_competencies' => array(
938 'classname' => 'core_competency\external',
939 'methodname' => 'list_competencies',
940 'classpath' => '',
941 'description' => 'Load a list of a competencies.',
942 'type' => 'read',
943 'capabilities' => 'moodle/competency:competencyview',
944 'ajax' => true,
945 ),
946 'core_competency_list_competencies_in_template' => array(
947 'classname' => 'core_competency\external',
948 'methodname' => 'list_competencies_in_template',
949 'classpath' => '',
950 'description' => 'Load a list of a competencies for a given template.',
951 'type' => 'read',
952 'capabilities' => 'moodle/competency:competencyview',
953 'ajax' => true,
954 ),
955 'core_competency_count_competencies' => array(
956 'classname' => 'core_competency\external',
957 'methodname' => 'count_competencies',
958 'classpath' => '',
959 'description' => 'Count a list of a competencies.',
960 'type' => 'read',
961 'capabilities' => 'moodle/competency:competencyview',
962 'ajax' => true,
963 ),
964 'core_competency_count_competencies_in_template' => array(
965 'classname' => 'core_competency\external',
966 'methodname' => 'count_competencies_in_template',
967 'classpath' => '',
968 'description' => 'Count a list of a competencies for a given template.',
969 'type' => 'read',
970 'capabilities' => 'moodle/competency:competencyview',
971 'ajax' => true,
972 ),
973 'core_competency_search_competencies' => array(
974 'classname' => 'core_competency\external',
975 'methodname' => 'search_competencies',
976 'classpath' => '',
977 'description' => 'Search a list of a competencies.',
978 'type' => 'read',
979 'capabilities' => 'moodle/competency:competencyview',
980 'ajax' => true,
981 ),
982 'core_competency_set_parent_competency' => array(
983 'classname' => 'core_competency\external',
984 'methodname' => 'set_parent_competency',
985 'classpath' => '',
986 'description' => 'Set a new parent for a competency.',
987 'type' => 'write',
988 'capabilities' => 'moodle/competency:competencymanage',
989 'ajax' => true,
990 ),
991 'core_competency_move_up_competency' => array(
992 'classname' => 'core_competency\external',
993 'methodname' => 'move_up_competency',
994 'classpath' => '',
995 'description' => 'Re-order a competency.',
996 'type' => 'write',
997 'capabilities' => 'moodle/competency:competencymanage',
998 'ajax' => true,
999 ),
1000 'core_competency_move_down_competency' => array(
1001 'classname' => 'core_competency\external',
1002 'methodname' => 'move_down_competency',
1003 'classpath' => '',
1004 'description' => 'Re-order a competency.',
1005 'type' => 'write',
1006 'capabilities' => 'moodle/competency:competencymanage',
1007 'ajax' => true,
1008 ),
1009 'core_competency_list_course_competencies' => array(
1010 'classname' => 'core_competency\external',
1011 'methodname' => 'list_course_competencies',
1012 'classpath' => '',
1013 'description' => 'List the competencies in a course',
1014 'type' => 'read',
1015 'capabilities' => 'moodle/competency:coursecompetencyview',
1016 'ajax' => true,
1017 ),
1018 'core_competency_count_competencies_in_course' => array(
1019 'classname' => 'core_competency\external',
1020 'methodname' => 'count_competencies_in_course',
1021 'classpath' => '',
1022 'description' => 'List the competencies in a course',
1023 'type' => 'read',
1024 'capabilities' => 'moodle/competency:coursecompetencyview',
1025 'ajax' => true,
1026 ),
1027 'core_competency_count_courses_using_competency' => array(
1028 'classname' => 'core_competency\external',
1029 'methodname' => 'count_courses_using_competency',
1030 'classpath' => '',
1031 'description' => 'List the courses using a competency',
1032 'type' => 'read',
1033 'capabilities' => 'moodle/competency:coursecompetencyview',
1034 'ajax' => true,
1035 ),
1036 'core_competency_add_competency_to_course' => array(
1037 'classname' => 'core_competency\external',
1038 'methodname' => 'add_competency_to_course',
1039 'classpath' => '',
1040 'description' => 'Add the competency to a course',
1041 'type' => 'write',
1042 'capabilities' => 'moodle/competency:coursecompetencymanage',
1043 'ajax' => true,
1044 ),
1045 'core_competency_add_competency_to_template' => array(
1046 'classname' => 'core_competency\external',
1047 'methodname' => 'add_competency_to_template',
1048 'classpath' => '',
1049 'description' => 'Add the competency to a template',
1050 'type' => 'write',
1051 'capabilities' => 'moodle/competency:templatemanage',
1052 'ajax' => true,
1053 ),
1054 'core_competency_remove_competency_from_course' => array(
1055 'classname' => 'core_competency\external',
1056 'methodname' => 'remove_competency_from_course',
1057 'classpath' => '',
1058 'description' => 'Remove a competency from a course',
1059 'type' => 'write',
1060 'capabilities' => 'moodle/competency:coursecompetencymanage',
1061 'ajax' => true,
1062 ),
1063 'core_competency_set_course_competency_ruleoutcome' => array(
1064 'classname' => 'core_competency\external',
1065 'methodname' => 'set_course_competency_ruleoutcome',
1066 'classpath' => '',
1067 'description' => 'Modify the ruleoutcome value for course competency',
1068 'type' => 'write',
1069 'capabilities' => 'moodle/competency:coursecompetencymanage',
1070 'ajax' => true,
1071 ),
1072 'core_competency_remove_competency_from_template' => array(
1073 'classname' => 'core_competency\external',
1074 'methodname' => 'remove_competency_from_template',
1075 'classpath' => '',
1076 'description' => 'Remove a competency from a template',
1077 'type' => 'write',
1078 'capabilities' => 'moodle/competency:templatemanage',
1079 'ajax' => true,
1080 ),
1081 'core_competency_reorder_course_competency' => array(
1082 'classname' => 'core_competency\external',
1083 'methodname' => 'reorder_course_competency',
1084 'classpath' => '',
1085 'description' => 'Move a course competency to a new relative sort order.',
1086 'type' => 'write',
1087 'capabilities' => 'moodle/competency:coursecompetencymanage',
1088 'ajax' => true,
1089 ),
1090 'core_competency_reorder_template_competency' => array(
1091 'classname' => 'core_competency\external',
1092 'methodname' => 'reorder_template_competency',
1093 'classpath' => '',
1094 'description' => 'Move a template competency to a new relative sort order.',
1095 'type' => 'write',
1096 'capabilities' => 'moodle/competency:templatemanage',
1097 'ajax' => true,
1098 ),
1099 'core_competency_create_template' => array(
1100 'classname' => 'core_competency\external',
1101 'methodname' => 'create_template',
1102 'classpath' => '',
1103 'description' => 'Creates new learning plan templates.',
1104 'type' => 'write',
1105 'capabilities' => 'moodle/competency:templatemanage',
1106 'ajax' => true,
1107 ),
1108 'core_competency_duplicate_template' => array(
1109 'classname' => 'core_competency\external',
1110 'methodname' => 'duplicate_template',
1111 'classpath' => '',
1112 'description' => 'Duplicate learning plan template.',
1113 'type' => 'write',
1114 'capabilities' => 'moodle/competency:templatemanage',
1115 'ajax' => true,
1116 ),
1117 'core_competency_read_template' => array(
1118 'classname' => 'core_competency\external',
1119 'methodname' => 'read_template',
1120 'classpath' => '',
1121 'description' => 'Load a summary of a learning plan template.',
1122 'type' => 'read',
1123 'capabilities' => 'moodle/competency:templateview',
1124 'ajax' => true,
1125 ),
1126 'core_competency_delete_template' => array(
1127 'classname' => 'core_competency\external',
1128 'methodname' => 'delete_template',
1129 'classpath' => '',
1130 'description' => 'Delete a learning plan template.',
1131 'type' => 'write',
1132 'capabilities' => 'moodle/competency:templatemanage',
1133 'ajax' => true,
1134 ),
1135 'core_competency_update_template' => array(
1136 'classname' => 'core_competency\external',
1137 'methodname' => 'update_template',
1138 'classpath' => '',
1139 'description' => 'Update a learning plan template.',
1140 'type' => 'write',
1141 'capabilities' => 'moodle/competency:templatemanage',
1142 'ajax' => true,
1143 ),
1144 'core_competency_list_templates' => array(
1145 'classname' => 'core_competency\external',
1146 'methodname' => 'list_templates',
1147 'classpath' => '',
1148 'description' => 'Load a list of a learning plan templates.',
1149 'type' => 'read',
1150 'capabilities' => 'moodle/competency:templateview',
1151 'ajax' => true,
1152 ),
1153 'core_competency_list_templates_using_competency' => array(
1154 'classname' => 'core_competency\external',
1155 'methodname' => 'list_templates_using_competency',
1156 'classpath' => '',
1157 'description' => 'Load a list of a learning plan templates for a given competency.',
1158 'type' => 'read',
1159 'capabilities' => 'moodle/competency:templateview',
1160 'ajax' => true,
1161 ),
1162 'core_competency_count_templates' => array(
1163 'classname' => 'core_competency\external',
1164 'methodname' => 'count_templates',
1165 'classpath' => '',
1166 'description' => 'Count a list of a learning plan templates.',
1167 'type' => 'read',
1168 'capabilities' => 'moodle/competency:templateview',
1169 'ajax' => true,
1170 ),
1171 'core_competency_count_templates_using_competency' => array(
1172 'classname' => 'core_competency\external',
1173 'methodname' => 'count_templates_using_competency',
1174 'classpath' => '',
1175 'description' => 'Count a list of a learning plan templates for a given competency.',
1176 'type' => 'read',
1177 'capabilities' => 'moodle/competency:templateview',
1178 'ajax' => true,
1179 ),
1180 'core_competency_create_plan' => array(
1181 'classname' => 'core_competency\external',
1182 'methodname' => 'create_plan',
1183 'classpath' => '',
1184 'description' => 'Creates a learning plan.',
1185 'type' => 'write',
1186 'capabilities' => 'moodle/competency:planmanage',
1187 'ajax' => true,
1188 ),
1189 'core_competency_update_plan' => array(
1190 'classname' => 'core_competency\external',
1191 'methodname' => 'update_plan',
1192 'classpath' => '',
1193 'description' => 'Updates a learning plan.',
1194 'type' => 'write',
1195 'capabilities' => 'moodle/competency:planmanage',
1196 'ajax' => true,
1197 ),
1198 'core_competency_complete_plan' => array(
1199 'classname' => 'core_competency\external',
1200 'methodname' => 'complete_plan',
1201 'classpath' => '',
1202 'description' => 'Complete learning plan.',
1203 'type' => 'write',
1204 'capabilities' => 'moodle/competency:planmanage',
1205 'ajax' => true,
1206 ),
1207 'core_competency_reopen_plan' => array(
1208 'classname' => 'core_competency\external',
1209 'methodname' => 'reopen_plan',
1210 'classpath' => '',
1211 'description' => 'Reopen learning plan.',
1212 'type' => 'write',
1213 'capabilities' => 'moodle/competency:planmanage',
1214 'ajax' => true,
1215 ),
1216 'core_competency_read_plan' => array(
1217 'classname' => 'core_competency\external',
1218 'methodname' => 'read_plan',
1219 'classpath' => '',
1220 'description' => 'Load a learning plan.',
1221 'type' => 'read',
1222 'capabilities' => 'moodle/competency:planviewown',
1223 'ajax' => true,
1224 ),
1225 'core_competency_delete_plan' => array(
1226 'classname' => 'core_competency\external',
1227 'methodname' => 'delete_plan',
1228 'classpath' => '',
1229 'description' => 'Delete a learning plan.',
1230 'type' => 'write',
1231 'capabilities' => 'moodle/competency:planmanage',
1232 'ajax' => true,
1233 ),
1234 'core_competency_list_user_plans' => array(
1235 'classname' => 'core_competency\external',
1236 'methodname' => 'list_user_plans',
1237 'classpath' => '',
1238 'description' => 'List a user\'s learning plans.',
1239 'type' => 'read',
1240 'capabilities' => 'moodle/competency:planviewown',
1241 'ajax' => true,
1242 ),
1243 'core_competency_list_plan_competencies' => array(
1244 'classname' => 'core_competency\external',
1245 'methodname' => 'list_plan_competencies',
1246 'classpath' => '',
1247 'description' => 'List the competencies in a plan',
1248 'type' => 'read',
1249 'capabilities' => 'moodle/competency:planviewown',
1250 'ajax' => true,
1251 ),
1252 'core_competency_add_competency_to_plan' => array(
1253 'classname' => 'core_competency\external',
1254 'methodname' => 'add_competency_to_plan',
1255 'classpath' => '',
1256 'description' => 'Add the competency to a learning plan',
1257 'type' => 'write',
1258 'capabilities' => 'moodle/competency:planmanage',
1259 'ajax' => true,
1260 ),
1261 'core_competency_remove_competency_from_plan' => array(
1262 'classname' => 'core_competency\external',
1263 'methodname' => 'remove_competency_from_plan',
1264 'classpath' => '',
1265 'description' => 'Remove the competency from a learning plan',
1266 'type' => 'write',
1267 'capabilities' => 'moodle/competency:planmanage',
1268 'ajax' => true,
1269 ),
1270 'core_competency_reorder_plan_competency' => array(
1271 'classname' => 'core_competency\external',
1272 'methodname' => 'reorder_plan_competency',
1273 'classpath' => '',
1274 'description' => 'Move a plan competency to a new relative sort order.',
1275 'type' => 'write',
1276 'capabilities' => 'moodle/competency:planmanage',
1277 'ajax' => true,
1278 ),
1279 'core_competency_plan_request_review' => array(
1280 'classname' => 'core_competency\external',
1281 'methodname' => 'plan_request_review',
1282 'classpath' => '',
1283 'description' => 'Request for a plan to be reviewed.',
1284 'type' => 'write',
1285 'capabilities' => 'moodle/competency:planmanagedraft',
1286 'ajax' => true,
1287 ),
1288 'core_competency_plan_start_review' => array(
1289 'classname' => 'core_competency\external',
1290 'methodname' => 'plan_start_review',
1291 'classpath' => '',
1292 'description' => 'Start the review of a plan.',
1293 'type' => 'write',
1294 'capabilities' => 'moodle/competency:planmanage',
1295 'ajax' => true,
1296 ),
1297 'core_competency_plan_stop_review' => array(
1298 'classname' => 'core_competency\external',
1299 'methodname' => 'plan_stop_review',
1300 'classpath' => '',
1301 'description' => 'Stop the review of a plan.',
1302 'type' => 'write',
1303 'capabilities' => 'moodle/competency:planmanage',
1304 'ajax' => true,
1305 ),
1306 'core_competency_plan_cancel_review_request' => array(
1307 'classname' => 'core_competency\external',
1308 'methodname' => 'plan_cancel_review_request',
1309 'classpath' => '',
1310 'description' => 'Cancel the review of a plan.',
1311 'type' => 'write',
1312 'capabilities' => 'moodle/competency:planmanagedraft',
1313 'ajax' => true,
1314 ),
1315 'core_competency_approve_plan' => array(
1316 'classname' => 'core_competency\external',
1317 'methodname' => 'approve_plan',
1318 'classpath' => '',
1319 'description' => 'Approve a plan.',
1320 'type' => 'write',
1321 'capabilities' => 'moodle/competency:planmanage',
1322 'ajax' => true,
1323 ),
1324 'core_competency_unapprove_plan' => array(
1325 'classname' => 'core_competency\external',
1326 'methodname' => 'unapprove_plan',
1327 'classpath' => '',
1328 'description' => 'Unapprove a plan.',
1329 'type' => 'write',
1330 'capabilities' => 'moodle/competency:planmanage',
1331 'ajax' => true,
1332 ),
1333 'core_competency_template_has_related_data' => array(
1334 'classname' => 'core_competency\external',
1335 'methodname' => 'template_has_related_data',
1336 'classpath' => '',
1337 'description' => 'Check if a template has related data',
1338 'type' => 'read',
1339 'capabilities' => 'moodle/competency:templateview',
1340 'ajax' => true,
1341 ),
1342 'core_competency_get_scale_values' => array(
1343 'classname' => 'core_competency\external',
1344 'methodname' => 'get_scale_values',
1345 'classpath' => '',
1346 'description' => 'Fetch the values for a specific scale',
1347 'type' => 'read',
1348 'capabilities' => 'moodle/competency:competencymanage',
1349 'ajax' => true,
1350 ),
1351 'core_competency_add_related_competency' => array(
1352 'classname' => 'core_competency\external',
1353 'methodname' => 'add_related_competency',
1354 'classpath' => '',
1355 'description' => 'Adds a related competency',
1356 'type' => 'write',
1357 'capabilities' => 'moodle/competency:competencymanage',
1358 'ajax' => true,
1359 ),
1360 'core_competency_remove_related_competency' => array(
1361 'classname' => 'core_competency\external',
1362 'methodname' => 'remove_related_competency',
1363 'classpath' => '',
1364 'description' => 'Remove a related competency',
1365 'type' => 'write',
1366 'capabilities' => 'moodle/competency:competencymanage',
1367 'ajax' => true,
1368 ),
1369 'core_competency_read_user_evidence' => array(
1370 'classname' => 'core_competency\external',
1371 'methodname' => 'read_user_evidence',
1372 'classpath' => '',
1373 'description' => 'Read an evidence of prior learning.',
1374 'type' => 'read',
1375 'capabilities' => 'moodle/competency:userevidenceview',
1376 'ajax' => true,
1377 ),
1378 'core_competency_delete_user_evidence' => array(
1379 'classname' => 'core_competency\external',
1380 'methodname' => 'delete_user_evidence',
1381 'classpath' => '',
1382 'description' => 'Delete an evidence of prior learning.',
1383 'type' => 'write',
1384 'capabilities' => 'moodle/competency:userevidencemanageown',
1385 'ajax' => true,
1386 ),
1387 'core_competency_create_user_evidence_competency' => array(
1388 'classname' => 'core_competency\external',
1389 'methodname' => 'create_user_evidence_competency',
1390 'classpath' => '',
1391 'description' => 'Create an evidence of prior learning relationship with a competency.',
1392 'type' => 'read',
1393 'capabilities' => 'moodle/competency:userevidencemanageown, moodle/competency:competencyview',
1394 'ajax' => true,
1395 ),
1396 'core_competency_delete_user_evidence_competency' => array(
1397 'classname' => 'core_competency\external',
1398 'methodname' => 'delete_user_evidence_competency',
1399 'classpath' => '',
1400 'description' => 'Delete an evidence of prior learning relationship with a competency.',
1401 'type' => 'write',
1402 'capabilities' => 'moodle/competency:userevidencemanageown',
1403 'ajax' => true,
1404 ),
1405 'core_competency_user_competency_cancel_review_request' => array(
1406 'classname' => 'core_competency\external',
1407 'methodname' => 'user_competency_cancel_review_request',
1408 'classpath' => '',
1409 'description' => 'Cancel a review request.',
1410 'type' => 'write',
1411 'capabilities' => 'moodle/competency:userevidencemanageown',
1412 'ajax' => true,
1413 ),
1414 'core_competency_user_competency_request_review' => array(
1415 'classname' => 'core_competency\external',
1416 'methodname' => 'user_competency_request_review',
1417 'classpath' => '',
1418 'description' => 'Request a review.',
1419 'type' => 'write',
1420 'capabilities' => 'moodle/competency:userevidencemanageown',
1421 'ajax' => true,
1422 ),
1423 'core_competency_user_competency_start_review' => array(
1424 'classname' => 'core_competency\external',
1425 'methodname' => 'user_competency_start_review',
1426 'classpath' => '',
1427 'description' => 'Start a review.',
1428 'type' => 'write',
1429 'capabilities' => 'moodle/competency:competencygrade',
1430 'ajax' => true,
1431 ),
1432 'core_competency_user_competency_stop_review' => array(
1433 'classname' => 'core_competency\external',
1434 'methodname' => 'user_competency_stop_review',
1435 'classpath' => '',
1436 'description' => 'Stop a review.',
1437 'type' => 'write',
1438 'capabilities' => 'moodle/competency:competencygrade',
1439 'ajax' => true,
1440 ),
1441 'core_competency_user_competency_viewed' => array(
1442 'classname' => 'core_competency\external',
1443 'methodname' => 'user_competency_viewed',
1444 'classpath' => '',
1445 'description' => 'Log the user competency viewed event.',
1446 'type' => 'read',
1447 'capabilities' => 'moodle/competency:usercompetencyview',
1448 'ajax' => true,
1449 ),
1450 'core_competency_user_competency_viewed_in_plan' => array(
1451 'classname' => 'core_competency\external',
1452 'methodname' => 'user_competency_viewed_in_plan',
1453 'classpath' => '',
1454 'description' => 'Log the user competency viewed in plan event.',
1455 'type' => 'read',
1456 'capabilities' => 'moodle/competency:usercompetencyview',
1457 'ajax' => true,
1458 ),
1459 'core_competency_user_competency_viewed_in_course' => array(
1460 'classname' => 'core_competency\external',
1461 'methodname' => 'user_competency_viewed_in_course',
1462 'classpath' => '',
1463 'description' => 'Log the user competency viewed in course event',
1464 'type' => 'read',
1465 'capabilities' => 'moodle/competency:usercompetencyview',
1466 'ajax' => true,
1467 ),
1468 'core_competency_user_competency_plan_viewed' => array(
1469 'classname' => 'core_competency\external',
1470 'methodname' => 'user_competency_plan_viewed',
1471 'classpath' => '',
1472 'description' => 'Log the user competency plan viewed event.',
1473 'type' => 'read',
1474 'capabilities' => 'moodle/competency:usercompetencyview',
1475 'ajax' => true,
1476 ),
1477 'core_competency_grade_competency' => array(
1478 'classname' => 'core_competency\external',
1479 'methodname' => 'grade_competency',
1480 'classpath' => '',
1481 'description' => 'Grade a competency.',
1482 'type' => 'write',
1483 'capabilities' => 'moodle/competency:competencygrade',
1484 'ajax' => true,
1485 ),
1486 'core_competency_grade_competency_in_plan' => array(
1487 'classname' => 'core_competency\external',
1488 'methodname' => 'grade_competency_in_plan',
1489 'classpath' => '',
1490 'description' => 'Grade a competency from the user plan page.',
1491 'type' => 'write',
1492 'capabilities' => 'moodle/competency:competencygrade',
1493 'ajax' => true,
1494 ),
1495 'core_competency_grade_competency_in_course' => array(
1496 'classname' => 'core_competency\external',
1497 'methodname' => 'grade_competency_in_course',
1498 'classpath' => '',
1499 'description' => 'Grade a competency from the course page.',
1500 'type' => 'write',
1501 'capabilities' => 'moodle/competency:competencygrade',
1502 'ajax' => true,
1503 ),
1504 'core_competency_unlink_plan_from_template' => array(
1505 'classname' => 'core_competency\external',
1506 'methodname' => 'unlink_plan_from_template',
1507 'classpath' => '',
1508 'description' => 'Unlink a plan form it template.',
1509 'type' => 'write',
1510 'capabilities' => 'moodle/competency:planmanage',
1511 'ajax' => true,
1512 ),
1513 'core_competency_template_viewed' => array(
1514 'classname' => 'core_competency\external',
1515 'methodname' => 'template_viewed',
1516 'classpath' => '',
1517 'description' => 'Log event template viewed',
1518 'type' => 'read',
1519 'capabilities' => 'moodle/competency:templateview',
1520 'ajax' => true,
1521 ),
1522 'core_competency_request_review_of_user_evidence_linked_competencies' => array(
1523 'classname' => 'core_competency\external',
1524 'methodname' => 'request_review_of_user_evidence_linked_competencies',
1525 'classpath' => '',
1526 'description' => 'Send user evidence competencies in review',
1527 'type' => 'write',
1528 'capabilities' => 'moodle/competency:userevidencemanageown',
1529 'ajax' => true,
1530 ),
1531 'core_competency_update_course_competency_settings' => array(
1532 'classname' => 'core_competency\external',
1533 'methodname' => 'update_course_competency_settings',
1534 'classpath' => '',
1535 'description' => 'Update the course competency settings',
1536 'type' => 'write',
1537 'capabilities' => 'moodle/competency:coursecompetencyconfigure',
1538 'ajax' => true,
1539 ),
1e99f31e
FM
1540 'core_competency_delete_evidence' => array(
1541 'classname' => 'core_competency\external',
1542 'methodname' => 'delete_evidence',
1543 'classpath' => '',
1544 'description' => 'Delete an evidence',
1545 'type' => 'write',
1546 'capabilities' => 'moodle/competency:evidencedelete',
1547 'ajax' => true,
1548 ),
f23e9b6b
CB
1549
1550 'core_webservice_get_site_info' => array(
1551 'classname' => 'core_webservice_external',
1552 'methodname' => 'get_site_info',
1553 'classpath' => 'webservice/externallib.php',
1554 'description' => 'Return some site info / user info / list web service functions',
1555 'type' => 'read',
1556 )
9a0df45a 1557);
c1b65883
JM
1558
1559$services = array(
96e0194c
SH
1560 'Moodle mobile web service' => array(
1561 'functions' => array (
f23e9b6b 1562 'core_badges_get_user_badges',
cb9d8257 1563 'core_calendar_get_calendar_events',
f23e9b6b
CB
1564 'core_comment_get_comments',
1565 'core_completion_get_activities_completion_status',
1566 'core_completion_get_course_completion_status',
1567 'core_completion_mark_course_self_completed',
1568 'core_completion_update_activity_completion_status_manually',
1569 'core_course_get_contents',
1570 'core_course_get_course_module',
1571 'core_course_get_course_module_by_instance',
1572 'core_course_get_courses',
1573 'core_course_search_courses',
1574 'core_course_view_course',
b8fbbc44 1575 'core_enrol_get_course_enrolment_methods',
f23e9b6b
CB
1576 'core_enrol_get_enrolled_users',
1577 'core_enrol_get_users_courses',
aff9da17 1578 'core_files_get_files',
f23e9b6b
CB
1579 'core_get_component_strings',
1580 'core_grades_update_grades',
1581 'core_group_get_activity_allowed_groups',
1582 'core_group_get_activity_groupmode',
1583 'core_group_get_course_user_groups',
1584 'core_message_block_contacts',
93872873
JL
1585 'core_message_create_contacts',
1586 'core_message_delete_contacts',
f23e9b6b
CB
1587 'core_message_delete_message',
1588 'core_message_get_blocked_users',
93872873 1589 'core_message_get_contacts',
f23e9b6b
CB
1590 'core_message_get_messages',
1591 'core_message_mark_message_read',
60ab2e1b 1592 'core_message_search_contacts',
f23e9b6b
CB
1593 'core_message_send_instant_messages',
1594 'core_message_unblock_contacts',
1595 'core_notes_create_notes',
1596 'core_notes_delete_notes',
9857381d 1597 'core_notes_get_course_notes',
a80b5518 1598 'core_notes_view_notes',
f23e9b6b 1599 'core_question_update_flag',
db5b6971 1600 'core_rating_get_item_ratings',
f23e9b6b 1601 'core_user_add_user_device',
32fb60e7 1602 'core_user_add_user_private_files',
f23e9b6b
CB
1603 'core_user_get_course_user_profiles',
1604 'core_user_get_users_by_field',
1605 'core_user_remove_user_device',
1606 'core_user_view_user_list',
1607 'core_user_view_user_profile',
1608 'core_webservice_get_site_info',
1609 'enrol_guest_get_instance_info',
1610 'enrol_self_enrol_user',
1611 'enrol_self_get_instance_info',
1612 'gradereport_user_get_grades_table',
1613 'gradereport_user_view_grade_report',
1614 'message_airnotifier_are_notification_preferences_configured',
1615 'message_airnotifier_is_system_configured',
1616 ),
96e0194c
SH
1617 'enabled' => 0,
1618 'restrictedusers' => 0,
af03513f 1619 'shortname' => MOODLE_OFFICIAL_MOBILE_SERVICE,
106c55fb
DW
1620 'downloadfiles' => 1,
1621 'uploadfiles' => 1
96e0194c
SH
1622 ),
1623);