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