|
| 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 mod_cms |
| 19 | + * |
| 20 | + * @package mod_cms |
| 21 | + * @author Marcus Boon<[email protected]> |
| 22 | + * @copyright Catalyst IT |
| 23 | + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
| 24 | + */ |
| 25 | +namespace mod_cms\privacy; |
| 26 | + |
| 27 | +use context; |
| 28 | +use core_privacy\local\request\userlist; |
| 29 | +use core_privacy\local\metadata\collection; |
| 30 | +use core_privacy\local\request\contextlist; |
| 31 | +use core_privacy\local\request\approved_contextlist; |
| 32 | +use core_privacy\local\request\approved_userlist; |
| 33 | + |
| 34 | +class provider implements |
| 35 | + \core_privacy\local\metadata\provider, |
| 36 | + \core_privacy\local\request\plugin\provider, |
| 37 | + \core_privacy\local\request\core_userlist_provider { |
| 38 | + |
| 39 | + /** |
| 40 | + * Get information about the user data stored by this plugin. |
| 41 | + * |
| 42 | + * @param collection $collection An object for storing metadata. |
| 43 | + * @return collection The metadata. |
| 44 | + */ |
| 45 | + public static function get_metadata(collection $collection) : collection { |
| 46 | + $collection->add_database_table( |
| 47 | + 'cms', |
| 48 | + [ |
| 49 | + 'usermodified' => 'privacy:metadata:cms:usermodified', |
| 50 | + ], |
| 51 | + 'privacy:metadata:cms' |
| 52 | + ); |
| 53 | + $collection->add_database_table( |
| 54 | + 'cms_types', |
| 55 | + [ |
| 56 | + 'moodleuid' => 'privacy:metadata:cms_types:usermodified', |
| 57 | + ], |
| 58 | + 'privacy:metadata:cms_types' |
| 59 | + ); |
| 60 | + |
| 61 | + return $collection; |
| 62 | + } |
| 63 | + |
| 64 | + /** |
| 65 | + * Get the list of contexts that contain user information for the specified user. |
| 66 | + * |
| 67 | + * @param int $userid The ID of the user |
| 68 | + * |
| 69 | + * @return contextlist |
| 70 | + */ |
| 71 | + public static function get_contexts_for_userid(int $userid) : contextlist { |
| 72 | + // Just enough to pass unit tests. |
| 73 | + return new contextlist(); |
| 74 | + } |
| 75 | + |
| 76 | + /** |
| 77 | + * Export personal data for the given approved_contextlist. |
| 78 | + * User and context information is contained within the contextlist. |
| 79 | + * |
| 80 | + * @param approved_contextlist $contextlist A list of contexts approved for export. |
| 81 | + */ |
| 82 | + public static function export_user_data(approved_contextlist $contextlist) { |
| 83 | + // Empty on purpose. |
| 84 | + } |
| 85 | + |
| 86 | + /** |
| 87 | + * Delete all data for all users in the specified context. |
| 88 | + * |
| 89 | + * @param context $context The context to delete in |
| 90 | + */ |
| 91 | + public static function delete_data_for_all_users_in_context(context $context) { |
| 92 | + // Empty on purpose. |
| 93 | + } |
| 94 | + |
| 95 | + /** |
| 96 | + * Delete all user data for the specified user, in the specified contexts. |
| 97 | + * |
| 98 | + * @param approved_contextlist $contextlist A list of contexts approved for deletion |
| 99 | + */ |
| 100 | + public static function delete_data_for_user(approved_contextlist $contextlist) { |
| 101 | + // Empty on purpose. |
| 102 | + } |
| 103 | + |
| 104 | + /** |
| 105 | + * Get the list of users who have data within a context. |
| 106 | + * |
| 107 | + * @param userlist $userlist The list of users who have data in this plugin. |
| 108 | + */ |
| 109 | + public static function get_users_in_context(userlist $userlist) { |
| 110 | + // Empty on purpose. |
| 111 | + } |
| 112 | + |
| 113 | + /** |
| 114 | + * Delete multiple users within a single context. |
| 115 | + * |
| 116 | + * @param approved_userlist $userlist The approved context and user information to delete. |
| 117 | + */ |
| 118 | + public static function delete_data_for_users(approved_userlist $userlist) { |
| 119 | + // Empty on purpose. |
| 120 | + } |
| 121 | +} |
0 commit comments