weekly release 2.1dev
[moodle.git] / lib / db / services.php
CommitLineData
9a0df45a 1<?php
2
3// This file is part of Moodle - http://moodle.org/
4//
5// Moodle is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// Moodle is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
17
18/**
19 * Core external functions and service definitions.
20 *
5b4a78e2 21 * @package core
9a0df45a 22 * @subpackage webservice
23 * @copyright 2009 Petr Skoda (http://skodak.org)
24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25 */
26
27$functions = array(
ef22c1b6 28
29 // === group related functions ===
f5072177 30
9a0df45a 31 'moodle_group_create_groups' => array(
32 'classname' => 'moodle_group_external',
33 'methodname' => 'create_groups',
34 'classpath' => 'group/externallib.php',
f5072177 35 'description' => 'Creates new groups.',
36 'type' => 'write',
72f68b51 37 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 38 ),
f5072177 39
9a0df45a 40 'moodle_group_get_groups' => array(
41 'classname' => 'moodle_group_external',
42 'methodname' => 'get_groups',
43 'classpath' => 'group/externallib.php',
cfb99b75 44 'description' => 'Returns group details.',
f5072177 45 'type' => 'read',
72f68b51 46 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 47 ),
246f6da2 48
49 'moodle_group_get_course_groups' => array(
50 'classname' => 'moodle_group_external',
51 'methodname' => 'get_course_groups',
52 'classpath' => 'group/externallib.php',
53 'description' => 'Returns all groups in specified course.',
54 'type' => 'read',
72f68b51 55 'capabilities'=> 'moodle/course:managegroups',
246f6da2 56 ),
2cb1ee78 57
9a0df45a 58 'moodle_group_delete_groups' => array(
59 'classname' => 'moodle_group_external',
60 'methodname' => 'delete_groups',
61 'classpath' => 'group/externallib.php',
0f4e72de
PS
62 'description' => 'Deletes all specified groups.',
63 'type' => 'delete',
72f68b51 64 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 65 ),
c863dc38 66
9a0df45a 67 'moodle_group_get_groupmembers' => array(
68 'classname' => 'moodle_group_external',
69 'methodname' => 'get_groupmembers',
70 'classpath' => 'group/externallib.php',
0f4e72de
PS
71 'description' => 'Returns group members.',
72 'type' => 'read',
72f68b51 73 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 74 ),
4efa2483 75
9a0df45a 76 'moodle_group_add_groupmembers' => array(
77 'classname' => 'moodle_group_external',
78 'methodname' => 'add_groupmembers',
79 'classpath' => 'group/externallib.php',
0f4e72de
PS
80 'description' => 'Adds group members.',
81 'type' => 'write',
72f68b51 82 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 83 ),
84
85 'moodle_group_delete_groupmembers' => array(
86 'classname' => 'moodle_group_external',
87 'methodname' => 'delete_groupmembers',
88 'classpath' => 'group/externallib.php',
0f4e72de
PS
89 'description' => 'Deletes group members.',
90 'type' => 'delete',
72f68b51 91 'capabilities'=> 'moodle/course:managegroups',
9a0df45a 92 ),
72f68b51 93
94
95 // === file related functions ===
96
249c4f60
DC
97 'moodle_file_get_files' => array(
98 'classname' => 'moodle_file_external',
99 'methodname' => 'get_files',
100 'description' => 'browse moodle files',
101 'type' => 'read',
102 'classpath' => 'files/externallib.php',
103 ),
104 'moodle_file_upload' => array(
105 'classname' => 'moodle_file_external',
106 'methodname' => 'upload',
107 'description' => 'upload a file to moodle',
108 'type' => 'write',
109 'classpath' => 'files/externallib.php',
110 ),
4efa2483 111
ef22c1b6 112 // === user related functions ===
72f68b51 113
ef22c1b6 114 'moodle_user_create_users' => array(
115 'classname' => 'moodle_user_external',
116 'methodname' => 'create_users',
117 'classpath' => 'user/externallib.php',
fb79269b 118 'description' => 'Create users.',
119 'type' => 'write',
72f68b51 120 'capabilities'=> 'moodle/user:create',
ef22c1b6 121 ),
122
fb79269b 123 'moodle_user_get_users_by_id' => array(
ef22c1b6 124 'classname' => 'moodle_user_external',
fb79269b 125 'methodname' => 'get_users_by_id',
ef22c1b6 126 'classpath' => 'user/externallib.php',
fb79269b 127 'description' => 'Get users by id.',
128 'type' => 'read',
ac3e0b3c 129 'capabilities'=> 'moodle/user:viewalldetails',
ef22c1b6 130 ),
131
132 'moodle_user_delete_users' => array(
133 'classname' => 'moodle_user_external',
134 'methodname' => 'delete_users',
135 'classpath' => 'user/externallib.php',
fb79269b 136 'description' => 'Delete users.',
137 'type' => 'write',
72f68b51 138 'capabilities'=> 'moodle/user:delete',
ef22c1b6 139 ),
140
141 'moodle_user_update_users' => array(
142 'classname' => 'moodle_user_external',
143 'methodname' => 'update_users',
144 'classpath' => 'user/externallib.php',
fb79269b 145 'description' => 'Update users.',
146 'type' => 'write',
72f68b51 147 'capabilities'=> 'moodle/user:update',
ef22c1b6 148 ),
e9b66095 149
72f68b51 150 // === enrol related functions ===
151
df997f84
PS
152 'moodle_enrol_get_enrolled_users' => array(
153 'classname' => 'moodle_enrol_external',
154 'methodname' => 'get_enrolled_users',
155 'classpath' => 'enrol/externallib.php',
156 'description' => 'Get list of course participants',
157 'type' => 'read',
72f68b51 158 'capabilities'=> 'moodle/site:viewparticipants, moodle/course:viewparticipants,
159 moodle/role:review, moodle/site:accessallgroups, moodle/course:enrolreview',
df997f84
PS
160 ),
161
162 'moodle_role_assign' => array(
e9b66095 163 'classname' => 'moodle_enrol_external',
164 'methodname' => 'role_assign',
165 'classpath' => 'enrol/externallib.php',
df997f84 166 'description' => 'Manual role assignments.',
e9b66095 167 'type' => 'write',
72f68b51 168 'capabilities'=> 'moodle/role:assign',
e9b66095 169 ),
170
df997f84 171 'moodle_role_unassign' => array(
e9b66095 172 'classname' => 'moodle_enrol_external',
173 'methodname' => 'role_unassign',
174 'classpath' => 'enrol/externallib.php',
df997f84 175 'description' => 'Manual role unassignments.',
e9b66095 176 'type' => 'write',
72f68b51 177 'capabilities'=> 'moodle/role:assign',
e9b66095 178 ),
5b4a78e2 179
6bb31e40 180 // === course related functions ===
181
182 'moodle_course_get_courses' => array(
183 'classname' => 'moodle_course_external',
184 'methodname' => 'get_courses',
185 'classpath' => 'course/externallib.php',
186 'description' => 'Return course details',
187 'type' => 'read',
188 'capabilities'=> 'moodle/course:view,moodle/course:update,moodle/course:viewhiddencourses',
189 ),
190
191 'moodle_course_create_courses' => array(
192 'classname' => 'moodle_course_external',
193 'methodname' => 'create_courses',
194 'classpath' => 'course/externallib.php',
195 'description' => 'Create new courses',
196 'type' => 'write',
197 'capabilities'=> 'moodle/course:create,moodle/course:visibility',
198 ),
199
9a0df45a 200);