MDL-63924 privacy: Add shared user providers to subsytsems

This commit is contained in:
Andrew Nicols 2018-11-08 15:32:39 +08:00
parent 44e56956c6
commit c96cd71102
20 changed files with 80 additions and 23 deletions

View File

@ -87,11 +87,17 @@ class metadata_registry {
$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;
}
}
}

View File

@ -36,7 +36,10 @@ defined('MOODLE_INTERNAL') || die();
* @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.

View File

@ -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.

View File

@ -37,7 +37,11 @@ use \core_privacy\local\request\userlist;
* @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.

View File

@ -41,7 +41,11 @@ require_once($CFG->dirroot . '/comment/lib.php');
* @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.

View File

@ -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.

View File

@ -26,7 +26,9 @@ namespace core_grading\privacy;
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.

View File

@ -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.

View File

@ -39,9 +39,11 @@ use core_privacy\local\request\userlist;
* @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.

View File

@ -28,7 +28,10 @@ namespace mod_assign\privacy;
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
@ -49,4 +52,4 @@ interface assignfeedback_user_provider extends \core_privacy\local\request\plugi
*/
public static function delete_feedback_for_grades(assign_plugin_request_data $deletedata);
}
}

View File

@ -30,7 +30,10 @@ use core_privacy\local\request\userlist;
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
@ -51,4 +54,4 @@ interface assignsubmission_user_provider extends \core_privacy\local\request\plu
*/
public static function delete_submissions(assign_plugin_request_data $deletedata);
}
}

View File

@ -33,7 +33,13 @@ defined('MOODLE_INTERNAL') || die();
* @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.

View File

@ -33,7 +33,10 @@ defined('MOODLE_INTERNAL') || die();
* @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.

View File

@ -34,7 +34,8 @@ defined('MOODLE_INTERNAL') || die();
*/
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.

View File

@ -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.

View File

@ -34,7 +34,10 @@ defined('MOODLE_INTERNAL') || die();
*/
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.

View File

@ -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.

View File

@ -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
{
/**

View File

@ -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.

View File

@ -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.