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 |
/**
|
|
|
18 |
* Privacy Subsystem implementation for Amanote filter.
|
|
|
19 |
*
|
|
|
20 |
* @package filter_amanote
|
|
|
21 |
* @copyright 2020 Amaplex Software
|
|
|
22 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
23 |
*/
|
|
|
24 |
|
|
|
25 |
namespace filter_amanote\privacy;
|
|
|
26 |
|
|
|
27 |
use core_privacy\local\metadata\collection;
|
|
|
28 |
use core_privacy\local\request\approved_contextlist;
|
|
|
29 |
use core_privacy\local\request\context;
|
|
|
30 |
use core_privacy\local\request\contextlist;
|
|
|
31 |
|
|
|
32 |
/**
|
|
|
33 |
* Provider implementation for Amanote filter.
|
|
|
34 |
*
|
|
|
35 |
* @copyright 2020 Amaplex Software
|
|
|
36 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
37 |
*/
|
|
|
38 |
class provider implements
|
|
|
39 |
\core_privacy\local\metadata\provider,
|
|
|
40 |
\core_privacy\local\request\plugin\provider {
|
|
|
41 |
|
|
|
42 |
/**
|
|
|
43 |
* Returns meta data about this system.
|
|
|
44 |
*
|
|
|
45 |
* @param collection $collection The initialised collection to add items to.
|
|
|
46 |
* @return collection A listing of user data stored through this system.
|
|
|
47 |
*/
|
|
|
48 |
public static function get_metadata(collection $collection) : collection {
|
|
|
49 |
// Data collected by the client.
|
|
|
50 |
$collection->add_external_location_link(
|
|
|
51 |
'amanote_client',
|
|
|
52 |
[
|
|
|
53 |
'userid' => 'privacy:metadata:userid',
|
|
|
54 |
'fullname' => 'privacy:metadata:fullname',
|
|
|
55 |
'email' => 'privacy:metadata:email',
|
|
|
56 |
'access_token' => 'privacy:metadata:access_token',
|
|
|
57 |
'access_token_expiration' => 'privacy:metadata:access_token_expiration',
|
|
|
58 |
],
|
|
|
59 |
'privacy:metadata'
|
|
|
60 |
);
|
|
|
61 |
|
|
|
62 |
// Files are stored using Moodle's file system.
|
|
|
63 |
$collection->add_subsystem_link('core_files', [], 'privacy:metadata:subsystem:corefiles');
|
|
|
64 |
|
|
|
65 |
return $collection;
|
|
|
66 |
}
|
|
|
67 |
|
|
|
68 |
/**
|
|
|
69 |
* Get the list of contexts that contain user information for the specified user.
|
|
|
70 |
*
|
|
|
71 |
* @param int $userid The user to search.
|
|
|
72 |
* @return contextlist $contextlist The list of contexts used in this plugin.
|
|
|
73 |
*/
|
|
|
74 |
public static function get_contexts_for_userid(int $userid) : contextlist {
|
|
|
75 |
return new contextlist();
|
|
|
76 |
}
|
|
|
77 |
|
|
|
78 |
/**
|
|
|
79 |
* Export all user data for the specified user, in the specified contexts.
|
|
|
80 |
*
|
|
|
81 |
* @param approved_contextlist $contextlist The approved contexts to export information for.
|
|
|
82 |
*/
|
|
|
83 |
public static function export_user_data(approved_contextlist $contextlist) {
|
|
|
84 |
}
|
|
|
85 |
|
|
|
86 |
/**
|
|
|
87 |
* Delete all data for all users in the specified context.
|
|
|
88 |
*
|
|
|
89 |
* @param context $context The specific context to delete data for.
|
|
|
90 |
*/
|
|
|
91 |
public static function delete_data_for_all_users_in_context(\context $context) {
|
|
|
92 |
}
|
|
|
93 |
|
|
|
94 |
/**
|
|
|
95 |
* Delete all user data for the specified user, in the specified contexts.
|
|
|
96 |
*
|
|
|
97 |
* @param approved_contextlist $contextlist The approved contexts and user information to delete information for.
|
|
|
98 |
*/
|
|
|
99 |
public static function delete_data_for_user(approved_contextlist $contextlist) {
|
|
|
100 |
}
|
|
|
101 |
}
|