1 |
efrain |
1 |
<?php
|
|
|
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 |
/**
|
|
|
17 |
* Chat external functions and service definitions.
|
|
|
18 |
*
|
|
|
19 |
* @package tool_dataprivacy
|
|
|
20 |
* @category external
|
|
|
21 |
* @copyright 2018 Jun Pataleta <jun@moodle.com>
|
|
|
22 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
23 |
*/
|
|
|
24 |
defined('MOODLE_INTERNAL') || die;
|
|
|
25 |
$functions = [
|
|
|
26 |
'tool_dataprivacy_cancel_data_request' => [
|
|
|
27 |
'classname' => 'tool_dataprivacy\external',
|
|
|
28 |
'methodname' => 'cancel_data_request',
|
|
|
29 |
'classpath' => '',
|
|
|
30 |
'description' => 'Cancel the data request made by the user',
|
|
|
31 |
'type' => 'write',
|
|
|
32 |
'capabilities' => '',
|
|
|
33 |
'ajax' => true,
|
|
|
34 |
'loginrequired' => true,
|
|
|
35 |
'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
|
|
|
36 |
],
|
|
|
37 |
'tool_dataprivacy_contact_dpo' => [
|
|
|
38 |
'classname' => 'tool_dataprivacy\external',
|
|
|
39 |
'methodname' => 'contact_dpo',
|
|
|
40 |
'classpath' => '',
|
|
|
41 |
'description' => 'Contact the site Data Protection Officer(s)',
|
|
|
42 |
'type' => 'write',
|
|
|
43 |
'capabilities' => '',
|
|
|
44 |
'ajax' => true,
|
|
|
45 |
'loginrequired' => true,
|
|
|
46 |
'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
|
|
|
47 |
],
|
|
|
48 |
'tool_dataprivacy_mark_complete' => [
|
|
|
49 |
'classname' => 'tool_dataprivacy\external',
|
|
|
50 |
'methodname' => 'mark_complete',
|
|
|
51 |
'classpath' => '',
|
|
|
52 |
'description' => 'Mark a user\'s general enquiry as complete',
|
|
|
53 |
'type' => 'write',
|
|
|
54 |
'capabilities' => 'tool/dataprivacy:managedatarequests',
|
|
|
55 |
'ajax' => true,
|
|
|
56 |
'loginrequired' => true,
|
|
|
57 |
],
|
|
|
58 |
'tool_dataprivacy_get_data_request' => [
|
|
|
59 |
'classname' => 'tool_dataprivacy\external',
|
|
|
60 |
'methodname' => 'get_data_request',
|
|
|
61 |
'classpath' => '',
|
|
|
62 |
'description' => 'Fetch the details of a user\'s data request',
|
|
|
63 |
'type' => 'read',
|
|
|
64 |
'capabilities' => 'tool/dataprivacy:managedatarequests',
|
|
|
65 |
'ajax' => true,
|
|
|
66 |
'loginrequired' => true,
|
|
|
67 |
],
|
|
|
68 |
'tool_dataprivacy_approve_data_request' => [
|
|
|
69 |
'classname' => 'tool_dataprivacy\external',
|
|
|
70 |
'methodname' => 'approve_data_request',
|
|
|
71 |
'classpath' => '',
|
|
|
72 |
'description' => 'Approve a data request',
|
|
|
73 |
'type' => 'write',
|
|
|
74 |
'capabilities' => 'tool/dataprivacy:managedatarequests',
|
|
|
75 |
'ajax' => true,
|
|
|
76 |
'loginrequired' => true,
|
|
|
77 |
],
|
|
|
78 |
'tool_dataprivacy_submit_selected_courses_form' => [
|
|
|
79 |
'classname' => 'tool_dataprivacy\external\submit_selected_courses_form',
|
|
|
80 |
'description' => 'Save list of selected courses for export',
|
|
|
81 |
'type' => 'write',
|
|
|
82 |
'capabilities' => 'tool/dataprivacy:managedatarequests',
|
|
|
83 |
'ajax' => true,
|
|
|
84 |
'loginrequired' => true,
|
|
|
85 |
],
|
|
|
86 |
'tool_dataprivacy_bulk_approve_data_requests' => [
|
|
|
87 |
'classname' => 'tool_dataprivacy\external',
|
|
|
88 |
'methodname' => 'bulk_approve_data_requests',
|
|
|
89 |
'classpath' => '',
|
|
|
90 |
'description' => 'Bulk approve data requests',
|
|
|
91 |
'type' => 'write',
|
|
|
92 |
'capabilities' => 'tool/dataprivacy:managedatarequests',
|
|
|
93 |
'ajax' => true,
|
|
|
94 |
'loginrequired' => true,
|
|
|
95 |
],
|
|
|
96 |
'tool_dataprivacy_deny_data_request' => [
|
|
|
97 |
'classname' => 'tool_dataprivacy\external',
|
|
|
98 |
'methodname' => 'deny_data_request',
|
|
|
99 |
'classpath' => '',
|
|
|
100 |
'description' => 'Deny a data request',
|
|
|
101 |
'type' => 'write',
|
|
|
102 |
'capabilities' => 'tool/dataprivacy:managedatarequests',
|
|
|
103 |
'ajax' => true,
|
|
|
104 |
'loginrequired' => true,
|
|
|
105 |
],
|
|
|
106 |
'tool_dataprivacy_bulk_deny_data_requests' => [
|
|
|
107 |
'classname' => 'tool_dataprivacy\external',
|
|
|
108 |
'methodname' => 'bulk_deny_data_requests',
|
|
|
109 |
'classpath' => '',
|
|
|
110 |
'description' => 'Bulk deny data requests',
|
|
|
111 |
'type' => 'write',
|
|
|
112 |
'capabilities' => 'tool/dataprivacy:managedatarequests',
|
|
|
113 |
'ajax' => true,
|
|
|
114 |
'loginrequired' => true,
|
|
|
115 |
],
|
|
|
116 |
'tool_dataprivacy_get_users' => [
|
|
|
117 |
'classname' => 'tool_dataprivacy\external',
|
|
|
118 |
'methodname' => 'get_users',
|
|
|
119 |
'classpath' => '',
|
|
|
120 |
'description' => 'Fetches a list of users',
|
|
|
121 |
'type' => 'read',
|
|
|
122 |
'capabilities' => 'tool/dataprivacy:managedatarequests',
|
|
|
123 |
'ajax' => true,
|
|
|
124 |
'loginrequired' => true,
|
|
|
125 |
],
|
|
|
126 |
'tool_dataprivacy_create_purpose_form' => [
|
|
|
127 |
'classname' => 'tool_dataprivacy\external',
|
|
|
128 |
'methodname' => 'create_purpose_form',
|
|
|
129 |
'classpath' => '',
|
|
|
130 |
'description' => 'Adds a data purpose',
|
|
|
131 |
'type' => 'write',
|
|
|
132 |
'capabilities' => '',
|
|
|
133 |
'ajax' => true,
|
|
|
134 |
'loginrequired' => true,
|
|
|
135 |
],
|
|
|
136 |
'tool_dataprivacy_create_category_form' => [
|
|
|
137 |
'classname' => 'tool_dataprivacy\external',
|
|
|
138 |
'methodname' => 'create_category_form',
|
|
|
139 |
'classpath' => '',
|
|
|
140 |
'description' => 'Adds a data category',
|
|
|
141 |
'type' => 'write',
|
|
|
142 |
'capabilities' => '',
|
|
|
143 |
'ajax' => true,
|
|
|
144 |
'loginrequired' => true,
|
|
|
145 |
],
|
|
|
146 |
'tool_dataprivacy_delete_purpose' => [
|
|
|
147 |
'classname' => 'tool_dataprivacy\external',
|
|
|
148 |
'methodname' => 'delete_purpose',
|
|
|
149 |
'classpath' => '',
|
|
|
150 |
'description' => 'Deletes an existing data purpose',
|
|
|
151 |
'type' => 'write',
|
|
|
152 |
'capabilities' => '',
|
|
|
153 |
'ajax' => true,
|
|
|
154 |
'loginrequired' => true,
|
|
|
155 |
],
|
|
|
156 |
'tool_dataprivacy_delete_category' => [
|
|
|
157 |
'classname' => 'tool_dataprivacy\external',
|
|
|
158 |
'methodname' => 'delete_category',
|
|
|
159 |
'classpath' => '',
|
|
|
160 |
'description' => 'Deletes an existing data category',
|
|
|
161 |
'type' => 'write',
|
|
|
162 |
'capabilities' => '',
|
|
|
163 |
'ajax' => true,
|
|
|
164 |
'loginrequired' => true,
|
|
|
165 |
],
|
|
|
166 |
'tool_dataprivacy_set_contextlevel_form' => [
|
|
|
167 |
'classname' => 'tool_dataprivacy\external',
|
|
|
168 |
'methodname' => 'set_contextlevel_form',
|
|
|
169 |
'classpath' => '',
|
|
|
170 |
'description' => 'Sets purpose and category across a context level',
|
|
|
171 |
'type' => 'write',
|
|
|
172 |
'capabilities' => '',
|
|
|
173 |
'ajax' => true,
|
|
|
174 |
'loginrequired' => true,
|
|
|
175 |
],
|
|
|
176 |
'tool_dataprivacy_set_context_form' => [
|
|
|
177 |
'classname' => 'tool_dataprivacy\external',
|
|
|
178 |
'methodname' => 'set_context_form',
|
|
|
179 |
'classpath' => '',
|
|
|
180 |
'description' => 'Sets purpose and category for a specific context',
|
|
|
181 |
'type' => 'write',
|
|
|
182 |
'capabilities' => '',
|
|
|
183 |
'ajax' => true,
|
|
|
184 |
'loginrequired' => true,
|
|
|
185 |
],
|
|
|
186 |
'tool_dataprivacy_tree_extra_branches' => [
|
|
|
187 |
'classname' => 'tool_dataprivacy\external',
|
|
|
188 |
'methodname' => 'tree_extra_branches',
|
|
|
189 |
'classpath' => '',
|
|
|
190 |
'description' => 'Return branches for the context tree',
|
|
|
191 |
'type' => 'write',
|
|
|
192 |
'capabilities' => '',
|
|
|
193 |
'ajax' => true,
|
|
|
194 |
'loginrequired' => true,
|
|
|
195 |
],
|
|
|
196 |
'tool_dataprivacy_confirm_contexts_for_deletion' => [
|
|
|
197 |
'classname' => 'tool_dataprivacy\external',
|
|
|
198 |
'methodname' => 'confirm_contexts_for_deletion',
|
|
|
199 |
'classpath' => '',
|
|
|
200 |
'description' => 'Mark the selected expired contexts as confirmed for deletion',
|
|
|
201 |
'type' => 'write',
|
|
|
202 |
'capabilities' => '',
|
|
|
203 |
'ajax' => true,
|
|
|
204 |
'loginrequired' => true,
|
|
|
205 |
],
|
|
|
206 |
'tool_dataprivacy_set_context_defaults' => [
|
|
|
207 |
'classname' => 'tool_dataprivacy\external',
|
|
|
208 |
'methodname' => 'set_context_defaults',
|
|
|
209 |
'classpath' => '',
|
|
|
210 |
'description' => 'Updates the default category and purpose for a given context level (and optionally, a plugin)',
|
|
|
211 |
'type' => 'write',
|
|
|
212 |
'capabilities' => 'tool/dataprivacy:managedataregistry',
|
|
|
213 |
'ajax' => true,
|
|
|
214 |
'loginrequired' => true,
|
|
|
215 |
],
|
|
|
216 |
'tool_dataprivacy_get_category_options' => [
|
|
|
217 |
'classname' => 'tool_dataprivacy\external',
|
|
|
218 |
'methodname' => 'get_category_options',
|
|
|
219 |
'classpath' => '',
|
|
|
220 |
'description' => 'Fetches a list of data category options',
|
|
|
221 |
'type' => 'read',
|
|
|
222 |
'capabilities' => 'tool/dataprivacy:managedataregistry',
|
|
|
223 |
'ajax' => true,
|
|
|
224 |
'loginrequired' => true,
|
|
|
225 |
],
|
|
|
226 |
'tool_dataprivacy_get_purpose_options' => [
|
|
|
227 |
'classname' => 'tool_dataprivacy\external',
|
|
|
228 |
'methodname' => 'get_purpose_options',
|
|
|
229 |
'classpath' => '',
|
|
|
230 |
'description' => 'Fetches a list of data storage purpose options',
|
|
|
231 |
'type' => 'read',
|
|
|
232 |
'capabilities' => 'tool/dataprivacy:managedataregistry',
|
|
|
233 |
'ajax' => true,
|
|
|
234 |
'loginrequired' => true,
|
|
|
235 |
],
|
|
|
236 |
'tool_dataprivacy_get_activity_options' => [
|
|
|
237 |
'classname' => 'tool_dataprivacy\external',
|
|
|
238 |
'methodname' => 'get_activity_options',
|
|
|
239 |
'classpath' => '',
|
|
|
240 |
'description' => 'Fetches a list of activity options',
|
|
|
241 |
'type' => 'read',
|
|
|
242 |
'capabilities' => 'tool/dataprivacy:managedataregistry',
|
|
|
243 |
'ajax' => true,
|
|
|
244 |
'loginrequired' => true,
|
|
|
245 |
],
|
|
|
246 |
'tool_dataprivacy_get_access_information' => [
|
|
|
247 |
'classname' => '\tool_dataprivacy\external\get_access_information',
|
|
|
248 |
'description' => 'Retrieving privacy API access (permissions) information for the current user.',
|
|
|
249 |
'type' => 'read',
|
|
|
250 |
'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
|
|
|
251 |
],
|
|
|
252 |
'tool_dataprivacy_create_data_request' => [
|
|
|
253 |
'classname' => '\tool_dataprivacy\external\create_data_request',
|
|
|
254 |
'description' => 'Creates a data request.',
|
|
|
255 |
'type' => 'write',
|
|
|
256 |
'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
|
|
|
257 |
],
|
|
|
258 |
'tool_dataprivacy_get_data_requests' => [
|
|
|
259 |
'classname' => '\tool_dataprivacy\external\get_data_requests',
|
|
|
260 |
'description' => 'Gets data request.',
|
|
|
261 |
'type' => 'read',
|
|
|
262 |
'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE],
|
|
|
263 |
],
|
|
|
264 |
];
|