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