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+ * Provider Class to implement the Privacy API of Moodle35.
19+ *
20+ * @package repository_owncloud
21+ * @copyright 2018 Nina Herrmann (Learnweb, University of Münster)
22+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23+ */
24+ namespace repository_owncloud \privacy ;
25+
26+ defined ('MOODLE_INTERNAL ' ) || die ();
27+
28+ use core_privacy \local \metadata \collection ;
29+ use core_privacy \local \request \approved_contextlist ;
30+ use core_privacy \local \request \contextlist ;
31+
32+ class provider implements
33+ \core_privacy \local \metadata \provider,
34+ \core_privacy \local \request \plugin \provider {
35+ use \core_privacy \local \legacy_polyfill;
36+
37+ public static function _get_metadata (collection $ collection ) {
38+ // The repository uses a user specific acesstoken (called confirmation token), provided by the oauthlib, ...
39+ // Saved in the session to access files. However, the oauthlib Privacy API is outsourced to the oauth2 plugin.
40+ // For this reason the collections includes the oauth2 subplugin.
41+ $ collection ->add_subsystem_link (
42+ 'auth_oauth2 ' ,
43+ [],
44+ 'privacy:metadata:auth_oauth2 '
45+ );
46+ return $ collection ;
47+ }
48+
49+ /**
50+ * Get the list of contexts that contain user information for the specified user.
51+ *
52+ * @param int $userid The user to search.
53+ * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin.
54+ */
55+ public static function _get_contexts_for_userid ($ userid ) {
56+ return new contextlist ();
57+ }
58+
59+ /**
60+ * Export all user data for the specified user, in the specified contexts.
61+ *
62+ * @param approved_contextlist $contextlist The approved contexts to export information for.
63+ */
64+ public static function _export_user_data (approved_contextlist $ contextlist ) {
65+ }
66+
67+ /**
68+ * Delete all data for all users in the specified context.
69+ *
70+ * @param context $context The specific context to delete data for.
71+ */
72+ public static function _delete_data_for_all_users_in_context (\context $ context ) {
73+ }
74+
75+ /**
76+ * Delete all user data for the specified user, in the specified contexts.
77+ *
78+ * @param approved_contextlist $contextlist The approved contexts and user information to delete information for.
79+ */
80+ public static function _delete_data_for_user (approved_contextlist $ contextlist ) {
81+ }
82+ }
0 commit comments