Skip to content

Commit

Permalink
MDL-63924 privacy: Add shared user providers to subsytsems
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Nov 8, 2018
1 parent 44e5695 commit c96cd71
Show file tree
Hide file tree
Showing 20 changed files with 80 additions and 23 deletions.
8 changes: 7 additions & 1 deletion admin/tool/dataprivacy/classes/metadata_registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,17 @@ public function get_registry_metadata() {
$internaldata['deprecated'] = true;
}

// Check that the userlist provider is implemented.
// Check that the core_userlist_provider is implemented for all user data providers.
if ($componentclass instanceof \core_privacy\local\request\core_user_data_provider
&& !$componentclass instanceof \core_privacy\local\request\core_userlist_provider) {
$internaldata['userlistnoncompliance'] = true;
}

// Check that any type of userlist_provider is implemented for all shared data providers.
if ($componentclass instanceof \core_privacy\local\request\shared_data_provider
&& !$componentclass instanceof \core_privacy\local\request\userlist_provider) {
$internaldata['userlistnoncompliance'] = true;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@
* @author Adrian Greeve <adriangreeve.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
interface logstore_userlist_provider extends \core_privacy\local\request\plugin\subplugin_provider {
interface logstore_userlist_provider extends
\core_privacy\local\request\plugin\subplugin_provider,
\core_privacy\local\request\shared_userlist_provider
{

/**
* Add user IDs that contain user information for the specified context.
Expand Down
4 changes: 3 additions & 1 deletion cache/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ class provider implements
\core_privacy\local\metadata\provider,

// The cache subsystem stores data on behalf of other components.
\core_privacy\local\request\subsystem\plugin_provider {
\core_privacy\local\request\subsystem\plugin_provider,
\core_privacy\local\request\shared_userlist_provider
{

/**
* Returns meta data about this system.
Expand Down
6 changes: 5 additions & 1 deletion comment/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
* @copyright 2018 Adrian Greeve <adrian@moodle.com>
* @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\plugin_provider {
class provider implements
\core_privacy\local\metadata\provider,
\core_privacy\local\request\subsystem\plugin_provider,
\core_privacy\local\request\shared_userlist_provider
{

/**
* Returns meta data about this system.
Expand Down
6 changes: 5 additions & 1 deletion completion/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@
* @copyright 2018 Adrian Greeve <adrian@moodle.com>
* @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\plugin_provider {
class provider implements
\core_privacy\local\metadata\provider,
\core_privacy\local\request\subsystem\plugin_provider,
\core_privacy\local\request\shared_userlist_provider
{

/**
* Returns meta data about this system.
Expand Down
3 changes: 2 additions & 1 deletion files/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class provider implements
\core_privacy\local\request\subsystem\plugin_provider,
\core_privacy\local\request\core_userlist_provider,
// We store a userkey for token-based file access.
\core_privacy\local\request\subsystem\provider {
\core_privacy\local\request\subsystem\provider,
\core_privacy\local\request\shared_userlist_provider {

/**
* Returns metadata.
Expand Down
4 changes: 3 additions & 1 deletion grade/grading/classes/privacy/gradingform_provider_v2.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
defined('MOODLE_INTERNAL') || die();

interface gradingform_provider_v2 extends
\core_privacy\local\request\plugin\subsystem_provider {
\core_privacy\local\request\plugin\subsystem_provider,
\core_privacy\local\request\shared_userlist_provider
{

/**
* Export user data relating to an instance ID.
Expand Down
4 changes: 3 additions & 1 deletion group/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ class provider implements
\core_privacy\local\request\subsystem\plugin_provider,

// This plugin is capable of determining which users have data within it.
\core_privacy\local\request\core_userlist_provider {
\core_privacy\local\request\core_userlist_provider,
\core_privacy\local\request\shared_userlist_provider
{

/**
* Returns meta data about this system.
Expand Down
6 changes: 4 additions & 2 deletions lib/userkey/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements
\core_privacy\local\metadata\provider,
\core_privacy\local\metadata\provider,

\core_privacy\local\request\subsystem\plugin_provider {
\core_privacy\local\request\subsystem\plugin_provider,
\core_privacy\local\request\shared_userlist_provider
{

/**
* Returns meta data about this system.
Expand Down
7 changes: 5 additions & 2 deletions mod/assign/classes/privacy/assignfeedback_user_provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@

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

interface assignfeedback_user_provider extends \core_privacy\local\request\plugin\subplugin_provider {
interface assignfeedback_user_provider extends
\core_privacy\local\request\plugin\subplugin_provider,
\core_privacy\local\request\shared_userlist_provider
{

/**
* If you have tables that contain userids and you can generate entries in your tables without creating an
Expand All @@ -49,4 +52,4 @@ public static function get_userids_from_context(\core_privacy\local\request\user
*/
public static function delete_feedback_for_grades(assign_plugin_request_data $deletedata);

}
}
7 changes: 5 additions & 2 deletions mod/assign/classes/privacy/assignsubmission_user_provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@

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

interface assignsubmission_user_provider extends \core_privacy\local\request\plugin\subplugin_provider {
interface assignsubmission_user_provider extends
\core_privacy\local\request\plugin\subplugin_provider,
\core_privacy\local\request\shared_userlist_provider
{

/**
* If you have tables that contain userids and you can generate entries in your tables without creating an
Expand All @@ -51,4 +54,4 @@ public static function get_userids_from_context(userlist $userlist);
*/
public static function delete_submissions(assign_plugin_request_data $deletedata);

}
}
8 changes: 7 additions & 1 deletion mod/data/classes/privacy/datafield_provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@
* @copyright 2018 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
interface datafield_provider extends \core_privacy\local\request\plugin\subplugin_provider {
interface datafield_provider extends
\core_privacy\local\request\plugin\subplugin_provider,

// The data subplugins do not need to do anything themselves for the shared_userlist.
// This is all handled by the parent plugin.
\core_privacy\local\request\shared_userlist_provider
{

/**
* Exports data about one record in {data_content} table.
Expand Down
5 changes: 4 additions & 1 deletion mod/workshop/classes/privacy/workshopform_provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@
* @copyright 2018 David Mudrák <david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
interface workshopform_provider extends \core_privacy\local\request\plugin\subplugin_provider {
interface workshopform_provider extends
\core_privacy\local\request\plugin\subplugin_provider,
\core_privacy\local\request\shared_userlist_provider
{

/**
* Return details of the filled assessment form.
Expand Down
3 changes: 2 additions & 1 deletion plagiarism/classes/privacy/plagiarims_user_provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
*/
interface plagiarism_user_provider extends
// The plagiarism_provider should be implemented by plugins which only provide information to a subsystem.
\core_privacy\local\request\plugin\subsystem_provider {
\core_privacy\local\request\plugin\subsystem_provider,
\core_privacy\local\request\shared_userlist_provider {

/**
* Delete all user information for the provided users and context.
Expand Down
4 changes: 3 additions & 1 deletion plagiarism/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ class provider implements
\core_privacy\local\metadata\provider,

// The Plagiarism subsystem will be called by other components and will forward requests to each plagiarism plugin implementing its APIs.
\core_privacy\local\request\subsystem\plugin_provider {
\core_privacy\local\request\subsystem\plugin_provider,
\core_privacy\local\request\shared_userlist_provider
{

/**
* Returns meta data about this system.
Expand Down
5 changes: 4 additions & 1 deletion portfolio/classes/privacy/portfolio_provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
*/
interface portfolio_provider extends
// The portfolio_provider should be implemented by plugins which only provide information to a subsystem.
\core_privacy\local\request\plugin\subsystem_provider {
\core_privacy\local\request\plugin\subsystem_provider,

// The implementation for prtfolios is handled in the subsystem itself.
\core_privacy\local\request\shared_userlist_provider {

/**
* Export all portfolio data from each portfolio plugin for the specified userid and context.
Expand Down
4 changes: 3 additions & 1 deletion portfolio/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ class provider implements
\core_privacy\local\request\plugin\provider,
\core_privacy\local\request\core_userlist_provider,
// The portfolio subsystem will be called by other components.
\core_privacy\local\request\subsystem\plugin_provider {
\core_privacy\local\request\subsystem\plugin_provider,

\core_privacy\local\request\shared_userlist_provider {

/**
* Returns meta data about this system.
Expand Down
5 changes: 4 additions & 1 deletion question/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ class provider implements
\core_privacy\local\request\subsystem\plugin_provider,

// This plugin is capable of determining which users have data within it.
\core_privacy\local\request\core_userlist_provider
\core_privacy\local\request\core_userlist_provider,

// This plugin is capable of determining which users have data within it for the plugins it provides data to.
\core_privacy\local\request\shared_userlist_provider
{

/**
Expand Down
4 changes: 3 additions & 1 deletion rating/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ class provider implements
// as a result.

// The ratings subsystem provides a data service to other components.
\core_privacy\local\request\subsystem\plugin_provider {
\core_privacy\local\request\subsystem\plugin_provider,
\core_privacy\local\request\shared_userlist_provider
{

/**
* Returns metadata about the ratings subsystem.
Expand Down
5 changes: 4 additions & 1 deletion tag/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ class provider implements
\core_privacy\local\request\core_userlist_provider,

// The tag subsystem may have data that belongs to this user.
\core_privacy\local\request\plugin\provider {
\core_privacy\local\request\plugin\provider,

\core_privacy\local\request\shared_userlist_provider
{

/**
* Returns meta data about this system.
Expand Down

0 comments on commit c96cd71

Please sign in to comment.