Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
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 ltiservice_memberships.
19
 *
20
 * @package    ltiservice_memberships
21
 * @copyright  2018 Mark Nelson <markn@moodle.com>
22
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23
 */
24
 
25
namespace ltiservice_memberships\privacy;
26
 
27
use \core_privacy\local\metadata\collection;
28
use \core_privacy\local\request\contextlist;
29
use \core_privacy\local\request\approved_contextlist;
30
use \core_privacy\local\request\userlist;
31
use \core_privacy\local\request\approved_userlist;
32
 
33
defined('MOODLE_INTERNAL') || die();
34
 
35
/**
36
 * Privacy Subsystem for ltiservice_memberships.
37
 *
38
 * @copyright  2018 Mark Nelson <markn@moodle.com>
39
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
40
 */
41
class provider implements
42
        \core_privacy\local\metadata\provider,
43
        \core_privacy\local\request\core_userlist_provider,
44
        \core_privacy\local\request\plugin\provider {
45
 
46
    /**
47
     * Returns meta data about this system.
48
     *
49
     * @param collection $collection The initialised collection to add items to.
50
     * @return collection A listing of user data stored through this system.
51
     */
52
    public static function get_metadata(collection $collection): collection {
53
        $collection->link_external_location('External LTI provider.', [
54
            'userid' => 'privacy:metadata:userid',
55
            'useridnumber' => 'privacy:metadata:useridnumber',
56
            'fullname' => 'privacy:metadata:fullname',
57
            'firstname' => 'privacy:metadata:firstname',
58
            'lastname' => 'privacy:metadata:lastname',
59
            'email' => 'privacy:metadata:email'
60
        ], 'privacy:metadata:externalpurpose');
61
 
62
        return $collection;
63
    }
64
 
65
    /**
66
     * Get the list of contexts that contain user information for the specified user.
67
     *
68
     * @param int $userid The user to search.
69
     * @return contextlist The contextlist containing the list of contexts used in this plugin.
70
     */
71
    public static function get_contexts_for_userid(int $userid): contextlist {
72
        return new contextlist();
73
    }
74
 
75
    /**
76
     * Get the list of users who have data within a context.
77
     *
78
     * @param userlist $userlist The userlist containing the list of users who have data in this context/plugin combination.
79
     */
80
    public static function get_users_in_context(userlist $userlist) {
81
    }
82
 
83
    /**
84
     * Export all user data for the specified user, in the specified contexts.
85
     *
86
     * @param approved_contextlist $contextlist The approved contexts to export information for.
87
     */
88
    public static function export_user_data(approved_contextlist $contextlist) {
89
    }
90
 
91
    /**
92
     * Delete all user data which matches the specified context.
93
     *
94
     * @param \context $context A user context.
95
     */
96
    public static function delete_data_for_all_users_in_context(\context $context) {
97
    }
98
 
99
    /**
100
     * Delete multiple users within a single context.
101
     *
102
     * @param approved_userlist $userlist The approved context and user information to delete information for.
103
     */
104
    public static function delete_data_for_users(approved_userlist $userlist) {
105
    }
106
 
107
    /**
108
     * Delete all user data for the specified user, in the specified contexts.
109
     *
110
     * @param approved_contextlist $contextlist The approved contexts and user information to delete information for.
111
     */
112
    public static function delete_data_for_user(approved_contextlist $contextlist) {
113
    }
114
}