Commit | Line | Data |
---|---|---|
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 | ||
fb79269b | 276 | 'moodle_user_get_users_by_id' => array( |
5d1017e1 JM |
277 | 'classname' => 'core_user_external', |
278 | 'methodname' => 'get_users_by_id', | |
279 | 'classpath' => 'user/externallib.php', | |
280 | 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_user_get_users_by_id()', | |
281 | 'type' => 'read', | |
282 | 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update', | |
283 | ), | |
284 | ||
c70b9853 | 285 | 'core_user_get_users_by_field' => array( |
86477112 | 286 | 'classname' => 'core_user_external', |
c70b9853 | 287 | 'methodname' => 'get_users_by_field', |
86477112 | 288 | 'classpath' => 'user/externallib.php', |
c70b9853 | 289 | 'description' => 'Retrieve users information for a specified unique field - If you want to do a user search, use core_user_get_users()', |
86477112 FS |
290 | 'type' => 'read', |
291 | 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update', | |
292 | ), | |
293 | ||
5d1017e1 JM |
294 | 'core_user_get_users_by_id' => array( |
295 | 'classname' => 'core_user_external', | |
fb79269b | 296 | 'methodname' => 'get_users_by_id', |
ef22c1b6 | 297 | 'classpath' => 'user/externallib.php', |
fb79269b | 298 | 'description' => 'Get users by id.', |
299 | 'type' => 'read', | |
b4c74367 | 300 | 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update', |
ef22c1b6 | 301 | ), |
302 | ||
01479290 | 303 | 'moodle_user_get_users_by_courseid' => array( |
5d1017e1 JM |
304 | 'classname' => 'core_enrol_external', |
305 | 'methodname' => 'get_enrolled_users', | |
306 | 'classpath' => 'enrol/externallib.php', | |
307 | '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 |
308 | 'type' => 'read', |
309 | 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups', | |
310 | ), | |
311 | ||
ea4e96c2 | 312 | 'moodle_user_get_course_participants_by_id' => array( |
5d1017e1 JM |
313 | 'classname' => 'core_user_external', |
314 | 'methodname' => 'get_course_user_profiles', | |
ea4e96c2 | 315 | 'classpath' => 'user/externallib.php', |
5d1017e1 JM |
316 | 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_user_get_course_user_profiles()', |
317 | 'type' => 'read', | |
318 | 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups', | |
319 | ), | |
320 | ||
321 | 'core_user_get_course_user_profiles' => array( | |
322 | 'classname' => 'core_user_external', | |
323 | 'methodname' => 'get_course_user_profiles', | |
324 | 'classpath' => 'user/externallib.php', | |
325 | 'description' => 'Get course user profiles (each of the profils matching a course id and a user id).', | |
ea4e96c2 DC |
326 | 'type' => 'read', |
327 | 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups', | |
328 | ), | |
329 | ||
ef22c1b6 | 330 | 'moodle_user_delete_users' => array( |
5d1017e1 JM |
331 | 'classname' => 'core_user_external', |
332 | 'methodname' => 'delete_users', | |
333 | 'classpath' => 'user/externallib.php', | |
334 | 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_user_delete_users()', | |
335 | 'type' => 'write', | |
336 | 'capabilities'=> 'moodle/user:delete', | |
337 | ), | |
338 | ||
339 | 'core_user_delete_users' => array( | |
340 | 'classname' => 'core_user_external', | |
ef22c1b6 | 341 | 'methodname' => 'delete_users', |
342 | 'classpath' => 'user/externallib.php', | |
fb79269b | 343 | 'description' => 'Delete users.', |
344 | 'type' => 'write', | |
72f68b51 | 345 | 'capabilities'=> 'moodle/user:delete', |
ef22c1b6 | 346 | ), |
347 | ||
348 | 'moodle_user_update_users' => array( | |
5d1017e1 JM |
349 | 'classname' => 'core_user_external', |
350 | 'methodname' => 'update_users', | |
351 | 'classpath' => 'user/externallib.php', | |
352 | 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_user_update_users()', | |
353 | 'type' => 'write', | |
354 | 'capabilities'=> 'moodle/user:update', | |
355 | ), | |
356 | ||
357 | 'core_user_update_users' => array( | |
358 | 'classname' => 'core_user_external', | |
ef22c1b6 | 359 | 'methodname' => 'update_users', |
360 | 'classpath' => 'user/externallib.php', | |
fb79269b | 361 | 'description' => 'Update users.', |
362 | 'type' => 'write', | |
72f68b51 | 363 | 'capabilities'=> 'moodle/user:update', |
ef22c1b6 | 364 | ), |
e9b66095 | 365 | |
72f68b51 | 366 | // === enrol related functions === |
d0068cd0 | 367 | |
b6b6c7ac PC |
368 | 'core_enrol_get_enrolled_users_with_capability' => array( |
369 | 'classname' => 'core_enrol_external', | |
370 | 'methodname' => 'get_enrolled_users_with_capability', | |
371 | 'classpath' => 'enrol/externallib.php', | |
372 | 'description' => 'For each course and capability specified, return a list of the users that are enrolled in the course | |
373 | and have that capability', | |
374 | 'type' => 'read', | |
375 | ), | |
72f68b51 | 376 | |
df997f84 PS |
377 | 'moodle_enrol_get_enrolled_users' => array( |
378 | 'classname' => 'moodle_enrol_external', | |
379 | 'methodname' => 'get_enrolled_users', | |
380 | 'classpath' => 'enrol/externallib.php', | |
5d1017e1 | 381 | '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 | 382 | 'type' => 'read', |
72f68b51 | 383 | 'capabilities'=> 'moodle/site:viewparticipants, moodle/course:viewparticipants, |
384 | moodle/role:review, moodle/site:accessallgroups, moodle/course:enrolreview', | |
df997f84 | 385 | ), |
e6acc551 | 386 | |
5d1017e1 JM |
387 | 'core_enrol_get_enrolled_users' => array( |
388 | 'classname' => 'core_enrol_external', | |
389 | 'methodname' => 'get_enrolled_users', | |
390 | 'classpath' => 'enrol/externallib.php', | |
391 | 'description' => 'Get enrolled users by course id.', | |
392 | 'type' => 'read', | |
393 | 'capabilities'=> 'moodle/user:viewdetails, moodle/user:viewhiddendetails, moodle/course:useremail, moodle/user:update, moodle/site:accessallgroups', | |
394 | ), | |
df997f84 | 395 | |
3364dbb5 | 396 | 'moodle_enrol_get_users_courses' => array( |
5d1017e1 | 397 | 'classname' => 'core_enrol_external', |
3364dbb5 PS |
398 | 'methodname' => 'get_users_courses', |
399 | 'classpath' => 'enrol/externallib.php', | |
5d1017e1 | 400 | '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 |
401 | 'type' => 'read', |
402 | 'capabilities'=> 'moodle/course:viewparticipants', | |
403 | ), | |
404 | ||
5d1017e1 JM |
405 | 'core_enrol_get_users_courses' => array( |
406 | 'classname' => 'core_enrol_external', | |
407 | 'methodname' => 'get_users_courses', | |
408 | 'classpath' => 'enrol/externallib.php', | |
409 | 'description' => 'Get the list of courses where a user is enrolled in', | |
410 | 'type' => 'read', | |
411 | 'capabilities'=> 'moodle/course:viewparticipants', | |
412 | ), | |
413 | ||
414 | // === Role related functions === | |
415 | ||
df997f84 | 416 | 'moodle_role_assign' => array( |
5d1017e1 JM |
417 | 'classname' => 'core_role_external', |
418 | 'methodname' => 'assign_roles', | |
419 | 'classpath' => 'enrol/externallib.php', | |
420 | 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_role_assign_role()', | |
421 | 'type' => 'write', | |
422 | 'capabilities'=> 'moodle/role:assign', | |
423 | ), | |
424 | ||
425 | 'core_role_assign_roles' => array( | |
426 | 'classname' => 'core_role_external', | |
427 | 'methodname' => 'assign_roles', | |
e9b66095 | 428 | 'classpath' => 'enrol/externallib.php', |
df997f84 | 429 | 'description' => 'Manual role assignments.', |
e9b66095 | 430 | 'type' => 'write', |
72f68b51 | 431 | 'capabilities'=> 'moodle/role:assign', |
e9b66095 | 432 | ), |
433 | ||
df997f84 | 434 | 'moodle_role_unassign' => array( |
5d1017e1 JM |
435 | 'classname' => 'core_role_external', |
436 | 'methodname' => 'unassign_roles', | |
437 | 'classpath' => 'enrol/externallib.php', | |
438 | 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_role_unassign_role()', | |
439 | 'type' => 'write', | |
440 | 'capabilities'=> 'moodle/role:assign', | |
441 | ), | |
442 | ||
443 | 'core_role_unassign_roles' => array( | |
444 | 'classname' => 'core_role_external', | |
445 | 'methodname' => 'unassign_roles', | |
e9b66095 | 446 | 'classpath' => 'enrol/externallib.php', |
df997f84 | 447 | 'description' => 'Manual role unassignments.', |
e9b66095 | 448 | 'type' => 'write', |
72f68b51 | 449 | 'capabilities'=> 'moodle/role:assign', |
e9b66095 | 450 | ), |
5b4a78e2 | 451 | |
6bb31e40 | 452 | // === course related functions === |
453 | ||
3ec163dd | 454 | 'core_course_get_contents' => array( |
d4a246bc | 455 | 'classname' => 'core_course_external', |
3ec163dd | 456 | 'methodname' => 'get_course_contents', |
d4a246bc | 457 | 'classpath' => 'course/externallib.php', |
3ec163dd | 458 | 'description' => 'Get course contents', |
d4a246bc | 459 | 'type' => 'read', |
3ec163dd | 460 | 'capabilities'=> 'moodle/course:update,moodle/course:viewhiddencourses', |
f2229c68 | 461 | ), |
d6ebe011 | 462 | |
6bb31e40 | 463 | 'moodle_course_get_courses' => array( |
5d1017e1 JM |
464 | 'classname' => 'core_course_external', |
465 | 'methodname' => 'get_courses', | |
466 | 'classpath' => 'course/externallib.php', | |
467 | 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_course_get_courses()', | |
468 | 'type' => 'read', | |
469 | 'capabilities'=> 'moodle/course:view,moodle/course:update,moodle/course:viewhiddencourses', | |
470 | ), | |
471 | ||
472 | 'core_course_get_courses' => array( | |
473 | 'classname' => 'core_course_external', | |
6bb31e40 | 474 | 'methodname' => 'get_courses', |
475 | 'classpath' => 'course/externallib.php', | |
476 | 'description' => 'Return course details', | |
477 | 'type' => 'read', | |
478 | 'capabilities'=> 'moodle/course:view,moodle/course:update,moodle/course:viewhiddencourses', | |
479 | ), | |
480 | ||
481 | 'moodle_course_create_courses' => array( | |
5d1017e1 JM |
482 | 'classname' => 'core_course_external', |
483 | 'methodname' => 'create_courses', | |
484 | 'classpath' => 'course/externallib.php', | |
485 | 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_course_create_courses()', | |
486 | 'type' => 'write', | |
487 | 'capabilities'=> 'moodle/course:create,moodle/course:visibility', | |
488 | ), | |
489 | ||
490 | 'core_course_create_courses' => array( | |
491 | 'classname' => 'core_course_external', | |
6bb31e40 | 492 | 'methodname' => 'create_courses', |
493 | 'classpath' => 'course/externallib.php', | |
494 | 'description' => 'Create new courses', | |
495 | 'type' => 'write', | |
496 | 'capabilities'=> 'moodle/course:create,moodle/course:visibility', | |
497 | ), | |
498 | ||
63a85dc7 JL |
499 | 'core_course_delete_courses' => array( |
500 | 'classname' => 'core_course_external', | |
501 | 'methodname' => 'delete_courses', | |
502 | 'classpath' => 'course/externallib.php', | |
503 | 'description' => 'Deletes all specified courses', | |
504 | 'type' => 'write', | |
505 | 'capabilities'=> 'moodle/course:delete', | |
506 | ), | |
507 | ||
3dc1d76e JL |
508 | 'core_course_duplicate_course' => array( |
509 | 'classname' => 'core_course_external', | |
510 | 'methodname' => 'duplicate_course', | |
511 | 'classpath' => 'course/externallib.php', | |
512 | 'description' => 'Duplicate an existing course (creating a new one) without user data', | |
513 | 'type' => 'write', | |
514 | 'capabilities'=> 'moodle/backup:backupcourse,moodle/restore:restorecourse,moodle/course:create', | |
515 | ), | |
516 | ||
3ec163dd EL |
517 | // === course category related functions === |
518 | ||
519 | 'core_course_get_categories' => array( | |
520 | 'classname' => 'core_course_external', | |
521 | 'methodname' => 'get_categories', | |
522 | 'classpath' => 'course/externallib.php', | |
523 | 'description' => 'Return category details', | |
524 | 'type' => 'read', | |
525 | 'capabilities'=> 'moodle/category:viewhiddencategories', | |
526 | ), | |
527 | ||
479a5db1 FS |
528 | 'core_course_create_categories' => array( |
529 | 'classname' => 'core_course_external', | |
530 | 'methodname' => 'create_categories', | |
531 | 'classpath' => 'course/externallib.php', | |
532 | 'description' => 'Create course categories', | |
533 | 'type' => 'write', | |
534 | 'capabilities'=> 'moodle/category:manage', | |
535 | ), | |
d6ebe011 | 536 | |
3ec163dd EL |
537 | 'core_course_update_categories' => array( |
538 | 'classname' => 'core_course_external', | |
539 | 'methodname' => 'update_categories', | |
540 | 'classpath' => 'course/externallib.php', | |
541 | 'description' => 'Update categories', | |
542 | 'type' => 'write', | |
afe27edc | 543 | 'capabilities'=> 'moodle/category:manage', |
3ec163dd EL |
544 | ), |
545 | ||
2f951d86 FS |
546 | 'core_course_delete_categories' => array( |
547 | 'classname' => 'core_course_external', | |
548 | 'methodname' => 'delete_categories', | |
549 | 'classpath' => 'course/externallib.php', | |
550 | 'description' => 'Delete course categories', | |
551 | 'type' => 'write', | |
552 | 'capabilities'=> 'moodle/category:manage', | |
553 | ), | |
479a5db1 | 554 | |
8430d87b JL |
555 | 'core_course_import_course' => array( |
556 | 'classname' => 'core_course_external', | |
557 | 'methodname' => 'import_course', | |
558 | 'classpath' => 'course/externallib.php', | |
559 | 'description' => 'Import course data from a course into another course. Does not include any user data.', | |
560 | 'type' => 'write', | |
561 | 'capabilities'=> 'moodle/backup:backuptargetimport, moodle/restore:restoretargetimport', | |
562 | ), | |
563 | ||
a623b6b8 JM |
564 | // === message related functions === |
565 | ||
4de00da7 | 566 | 'moodle_message_send_instantmessages' => array( |
5d1017e1 JM |
567 | 'classname' => 'core_message_external', |
568 | 'methodname' => 'send_instant_messages', | |
569 | 'classpath' => 'message/externallib.php', | |
570 | 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_message_send_instant_messages()', | |
571 | 'type' => 'write', | |
572 | 'capabilities'=> 'moodle/site:sendmessage', | |
573 | ), | |
574 | ||
575 | 'core_message_send_instant_messages' => array( | |
576 | 'classname' => 'core_message_external', | |
577 | 'methodname' => 'send_instant_messages', | |
a623b6b8 | 578 | 'classpath' => 'message/externallib.php', |
4de00da7 | 579 | 'description' => 'Send instant messages', |
a623b6b8 JM |
580 | 'type' => 'write', |
581 | 'capabilities'=> 'moodle/site:sendmessage', | |
582 | ), | |
583 | ||
d6731600 FM |
584 | 'core_message_create_contacts' => array( |
585 | 'classname' => 'core_message_external', | |
586 | 'methodname' => 'create_contacts', | |
587 | 'classpath' => 'message/externallib.php', | |
588 | 'description' => 'Add contacts to the contact list', | |
589 | 'type' => 'write', | |
590 | 'capabilities'=> '', | |
591 | ), | |
592 | ||
593 | 'core_message_delete_contacts' => array( | |
594 | 'classname' => 'core_message_external', | |
595 | 'methodname' => 'delete_contacts', | |
596 | 'classpath' => 'message/externallib.php', | |
597 | 'description' => 'Remove contacts from the contact list', | |
598 | 'type' => 'write', | |
599 | 'capabilities'=> '', | |
600 | ), | |
601 | ||
602 | 'core_message_block_contacts' => array( | |
603 | 'classname' => 'core_message_external', | |
604 | 'methodname' => 'block_contacts', | |
605 | 'classpath' => 'message/externallib.php', | |
606 | 'description' => 'Block contacts', | |
607 | 'type' => 'write', | |
608 | 'capabilities'=> '', | |
609 | ), | |
610 | ||
611 | 'core_message_unblock_contacts' => array( | |
612 | 'classname' => 'core_message_external', | |
613 | 'methodname' => 'unblock_contacts', | |
614 | 'classpath' => 'message/externallib.php', | |
615 | 'description' => 'Unblock contacts', | |
616 | 'type' => 'write', | |
617 | 'capabilities'=> '', | |
618 | ), | |
619 | ||
620 | 'core_message_get_contacts' => array( | |
621 | 'classname' => 'core_message_external', | |
622 | 'methodname' => 'get_contacts', | |
623 | 'classpath' => 'message/externallib.php', | |
624 | 'description' => 'Retrieve the contact list', | |
625 | 'type' => 'read', | |
626 | 'capabilities'=> '', | |
627 | ), | |
628 | ||
629 | 'core_message_search_contacts' => array( | |
630 | 'classname' => 'core_message_external', | |
631 | 'methodname' => 'search_contacts', | |
632 | 'classpath' => 'message/externallib.php', | |
633 | 'description' => 'Search for contacts', | |
634 | 'type' => 'read', | |
635 | 'capabilities'=> '', | |
636 | ), | |
637 | ||
8d46dabb JM |
638 | // === notes related functions === |
639 | ||
640 | 'moodle_notes_create_notes' => array( | |
5d1017e1 JM |
641 | 'classname' => 'core_notes_external', |
642 | 'methodname' => 'create_notes', | |
643 | 'classpath' => 'notes/externallib.php', | |
644 | 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_notes_create_notes()', | |
645 | 'type' => 'write', | |
646 | 'capabilities'=> 'moodle/notes:manage', | |
647 | ), | |
648 | ||
649 | 'core_notes_create_notes' => array( | |
650 | 'classname' => 'core_notes_external', | |
8d46dabb JM |
651 | 'methodname' => 'create_notes', |
652 | 'classpath' => 'notes/externallib.php', | |
653 | 'description' => 'Create notes', | |
654 | 'type' => 'write', | |
655 | 'capabilities'=> 'moodle/notes:manage', | |
656 | ), | |
657 | ||
0bf486a6 JM |
658 | // === webservice related functions === |
659 | ||
660 | 'moodle_webservice_get_siteinfo' => array( | |
5d1017e1 JM |
661 | 'classname' => 'core_webservice_external', |
662 | 'methodname' => 'get_site_info', | |
663 | 'classpath' => 'webservice/externallib.php', | |
664 | 'description' => 'DEPRECATED: this deprecated function will be removed in a future version. This function has be renamed as core_webservice_get_site_info()', | |
665 | 'type' => 'read', | |
666 | ), | |
667 | ||
668 | 'core_webservice_get_site_info' => array( | |
669 | 'classname' => 'core_webservice_external', | |
670 | 'methodname' => 'get_site_info', | |
0bf486a6 JM |
671 | 'classpath' => 'webservice/externallib.php', |
672 | 'description' => 'Return some site info / user info / list web service functions', | |
673 | 'type' => 'read', | |
674 | ), | |
675 | ||
11e76602 JM |
676 | 'core_get_string' => array( |
677 | 'classname' => 'core_external', | |
678 | 'methodname' => 'get_string', | |
679 | 'classpath' => 'lib/external/externallib.php', | |
680 | 'description' => 'Return a translated string - similar to core get_string() call', | |
681 | 'type' => 'read', | |
682 | ), | |
683 | ||
684 | 'core_get_strings' => array( | |
685 | 'classname' => 'core_external', | |
686 | 'methodname' => 'get_strings', | |
687 | 'classpath' => 'lib/external/externallib.php', | |
688 | 'description' => 'Return some translated strings - like several core get_string() calls', | |
689 | 'type' => 'read', | |
690 | ), | |
691 | ||
692 | 'core_get_component_strings' => array( | |
693 | 'classname' => 'core_external', | |
694 | 'methodname' => 'get_component_strings', | |
695 | 'classpath' => 'lib/external/externallib.php', | |
696 | 'description' => 'Return all raw strings (with {$a->xxx}) for a specific component | |
697 | - similar to core get_component_strings() call', | |
698 | 'type' => 'read', | |
699 | ), | |
5e1350ab AA |
700 | |
701 | ||
702 | // === Calendar related functions === | |
703 | ||
704 | 'core_calendar_delete_calendar_events' => array( | |
705 | 'classname' => 'core_calendar_external', | |
706 | 'methodname' => 'delete_calendar_events', | |
707 | 'description' => 'Delete calendar events', | |
708 | 'classpath' => 'calendar/externallib.php', | |
709 | 'type' => 'write', | |
710 | 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries' | |
711 | ), | |
712 | ||
793d3855 AA |
713 | |
714 | 'core_calendar_get_calendar_events' => array( | |
715 | 'classname' => 'core_calendar_external', | |
716 | 'methodname' => 'get_calendar_events', | |
717 | 'description' => 'Get calendar events', | |
718 | 'classpath' => 'calendar/externallib.php', | |
719 | 'type' => 'read', | |
720 | 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries' | |
721 | ), | |
722 | ||
c66dc3df AA |
723 | 'core_calendar_create_calendar_events' => array( |
724 | 'classname' => 'core_calendar_external', | |
725 | 'methodname' => 'create_calendar_events', | |
726 | 'description' => 'Create calendar events', | |
727 | 'classpath' => 'calendar/externallib.php', | |
728 | 'type' => 'write', | |
729 | 'capabilities'=> 'moodle/calendar:manageentries', 'moodle/calendar:manageownentries', 'moodle/calendar:managegroupentries' | |
730 | ), | |
9a0df45a | 731 | ); |
c1b65883 JM |
732 | |
733 | $services = array( | |
96e0194c SH |
734 | 'Moodle mobile web service' => array( |
735 | 'functions' => array ( | |
736 | 'moodle_enrol_get_users_courses', | |
737 | 'moodle_enrol_get_enrolled_users', | |
f2806b9a JM |
738 | 'moodle_user_get_users_by_id', |
739 | 'moodle_webservice_get_siteinfo', | |
740 | 'moodle_notes_create_notes', | |
ea4e96c2 | 741 | 'moodle_user_get_course_participants_by_id', |
01479290 | 742 | 'moodle_user_get_users_by_courseid', |
ec0d6ea2 | 743 | 'moodle_message_send_instantmessages', |
11e76602 JM |
744 | 'core_course_get_contents', |
745 | 'core_get_component_strings'), | |
96e0194c SH |
746 | 'enabled' => 0, |
747 | 'restrictedusers' => 0, | |
af03513f JM |
748 | 'shortname' => MOODLE_OFFICIAL_MOBILE_SERVICE, |
749 | 'downloadfiles' => 1 | |
96e0194c SH |
750 | ), |
751 | ); |