Skip to content

Commit

Permalink
Merge branch 'MDL-63713-34' of git://github.com/rezaies/moodle into M…
Browse files Browse the repository at this point in the history
…OODLE_34_STABLE
  • Loading branch information
andrewnicols committed Oct 23, 2018
2 parents a9564af + 991aa49 commit b3ad855
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions lib/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* Privacy class for requesting user data.
*
* @package core
* @category privacy
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
Expand All @@ -26,9 +27,11 @@

defined('MOODLE_INTERNAL') || die();

use \core_privacy\local\metadata\collection;
use \core_privacy\local\request\contextlist;
use \core_privacy\local\request\approved_contextlist;
use core_privacy\local\metadata\collection;
use core_privacy\local\request\approved_contextlist;
use core_privacy\local\request\approved_userlist;
use core_privacy\local\request\contextlist;
use core_privacy\local\request\userlist;

/**
* Privacy class for requesting user data.
Expand All @@ -37,7 +40,10 @@
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements \core_privacy\local\metadata\provider, \core_privacy\local\request\subsystem\provider {
class provider implements
\core_privacy\local\metadata\provider,
\core_privacy\local\request\subsystem\provider,
\core_privacy\local\request\core_userlist_provider {

/**
* Returns information about the user data stored in this component.
Expand Down Expand Up @@ -114,6 +120,15 @@ public static function get_contexts_for_userid(int $userid) : contextlist {
return new contextlist();
}

/**
* Get the list of users who have data within a context.
*
* @param userlist $userlist The userlist containing the list of users who have data in this context/plugin combination.
*/
public static function get_users_in_context(userlist $userlist) {
// Don't add any user.
}

/**
* Export all user data for the specified user, in the specified contexts.
*
Expand Down Expand Up @@ -142,4 +157,15 @@ public static function delete_data_for_user(approved_contextlist $contextlist) {
// Note: Although it may be tempting to delete the adhoc task data, do not do so.
// The delete process is run as an adhoc task.
}

/**
* Delete multiple users within a single context.
*
* @param approved_userlist $userlist The approved context and user information to delete information for.
*/
public static function delete_data_for_users(approved_userlist $userlist) {
// None of the the data from these tables should be deleted.
// Note: Although it may be tempting to delete the adhoc task data, do not do so.
// The delete process is run as an adhoc task.
}
}

0 comments on commit b3ad855

Please sign in to comment.