2 // This file is part of Moodle - http://moodle.org/
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.
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.
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/>.
18 * Privacy class for requesting user data.
20 * @package portfolio_flickr
21 * @copyright 2018 Jake Dallimore <jrhdallimore@gmail.com>
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24 namespace portfolio_flickr\privacy;
26 defined('MOODLE_INTERNAL') || die();
28 use core_privacy\local\metadata\collection;
31 * Provider for the portfolio_flickr plugin.
33 * @copyright 2018 Jake Dallimore <jrhdallimore@gmail.com>
34 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
36 class provider implements
37 // This portfolio plugin does not store any data itself.
38 // It has no database tables, and it purely acts as a conduit, sending data externally.
39 \core_portfolio\privacy\portfolio_provider {
42 * Returns meta data about this system.
44 * @param collection $collection The initialised collection to add items to.
45 * @return collection A listing of user data stored through this system.
47 public static function get_metadata(collection $collection) : collection {
48 return $collection->add_external_location_link('Flickr account', ['data' => 'privacy:metadata:data'], 'privacy:metadata');
52 * Export all portfolio data from each portfolio plugin for the specified userid and context.
54 * @param int $userid The user to export.
55 * @param \context $context The context to export.
56 * @param array $subcontext The subcontext within the context to export this information to.
57 * @param array $linkarray The weird and wonderful link array used to display information for a specific item
59 public static function export_portfolio_user_data(int $userid, \context $context, array $subcontext, array $linkarray) {
63 * Delete all user information for the provided context.
65 * @param \context $context The context to delete user data for.
67 public static function delete_portfolio_for_context(\context $context) {
71 * Delete all user information for the provided user and context.
73 * @param int $userid The user to delete
74 * @param \context $context The context to refine the deletion.
76 public static function delete_portfolio_for_user(int $userid, \context $context) {