Merge branch 'MDL-63924-35' of git://github.com/andrewnicols/moodle into MOODLE_35_STABLE

This commit is contained in:
Jun Pataleta 2018-11-09 11:57:31 +08:00
commit 3af336b41a
23 changed files with 155 additions and 24 deletions

View file

@ -87,11 +87,17 @@ class metadata_registry {
$internaldata['deprecated'] = true; $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 if ($componentclass instanceof \core_privacy\local\request\core_user_data_provider
&& !$componentclass instanceof \core_privacy\local\request\core_userlist_provider) { && !$componentclass instanceof \core_privacy\local\request\core_userlist_provider) {
$internaldata['userlistnoncompliance'] = true; $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> * @author Adrian Greeve <adriangreeve.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @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. * 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, \core_privacy\local\metadata\provider,
// The cache subsystem stores data on behalf of other components. // 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. * 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> * @copyright 2018 Adrian Greeve <adrian@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @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. * 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> * @copyright 2018 Adrian Greeve <adrian@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @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. * 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\subsystem\plugin_provider,
\core_privacy\local\request\core_userlist_provider, \core_privacy\local\request\core_userlist_provider,
// We store a userkey for token-based file access. // 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. * Returns metadata.

View file

@ -26,7 +26,9 @@ namespace core_grading\privacy;
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
interface gradingform_provider_v2 extends 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. * Export user data relating to an instance ID.

View file

@ -51,7 +51,9 @@ class provider implements
\core_privacy\local\request\subsystem\plugin_provider, \core_privacy\local\request\subsystem\plugin_provider,
// This plugin is capable of determining which users have data within it. // 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. * 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 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
class provider implements 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. * Returns meta data about this system.

View file

@ -28,7 +28,10 @@ namespace mod_assign\privacy;
defined('MOODLE_INTERNAL') || die(); 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 * 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); 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(); 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 * 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); public static function delete_submissions(assign_plugin_request_data $deletedata);
} }

View file

@ -33,7 +33,13 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2018 Marina Glancy * @copyright 2018 Marina Glancy
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @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. * 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> * @copyright 2018 David Mudrák <david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @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. * Return details of the filled assessment form.

View file

@ -34,7 +34,8 @@ defined('MOODLE_INTERNAL') || die();
*/ */
interface plagiarism_user_provider extends interface plagiarism_user_provider extends
// The plagiarism_provider should be implemented by plugins which only provide information to a subsystem. // 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. * Delete all user information for the provided users and context.

View file

@ -40,7 +40,9 @@ class provider implements
\core_privacy\local\metadata\provider, \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. // 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. * Returns meta data about this system.

View file

@ -34,7 +34,10 @@ defined('MOODLE_INTERNAL') || die();
*/ */
interface portfolio_provider extends interface portfolio_provider extends
// The portfolio_provider should be implemented by plugins which only provide information to a subsystem. // 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. * 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\plugin\provider,
\core_privacy\local\request\core_userlist_provider, \core_privacy\local\request\core_userlist_provider,
// The portfolio subsystem will be called by other components. // 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. * Returns meta data about this system.

View file

@ -33,7 +33,7 @@ defined('MOODLE_INTERNAL') || die();
* @package core_privacy * @package core_privacy
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk> * @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
*/ */
interface core_userlist_provider { interface core_userlist_provider extends userlist_provider {
/** /**
* Get the list of users who have data within a context. * Get the list of users who have data within a context.

View file

@ -0,0 +1,37 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains an interface to describe classes which provide user data in some form for shared providers.
*
* @package core_privacy
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_privacy\local\request;
defined('MOODLE_INTERNAL') || die();
/**
* The interface is used to describe a provider which is capable of identifying the users who have data within it.
*
* It describes data how these requests are serviced in a specific format.
*
* @package core_privacy
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
*/
interface shared_userlist_provider extends userlist_provider {
}

View file

@ -0,0 +1,37 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains an interface to describe classes which userlist support.
*
* @package core_privacy
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_privacy\local\request;
defined('MOODLE_INTERNAL') || die();
/**
* The interface is used to describe a provider which is capable of identifying the users who have data within it.
*
* It describes data how these requests are serviced in a specific format.
*
* @package core_privacy
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
*/
interface userlist_provider {
}

View file

@ -61,7 +61,10 @@ class provider implements
\core_privacy\local\request\subsystem\plugin_provider, \core_privacy\local\request\subsystem\plugin_provider,
// This plugin is capable of determining which users have data within it. // 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. // as a result.
// The ratings subsystem provides a data service to other components. // 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. * Returns metadata about the ratings subsystem.

View file

@ -51,7 +51,10 @@ class provider implements
\core_privacy\local\request\core_userlist_provider, \core_privacy\local\request\core_userlist_provider,
// The tag subsystem may have data that belongs to this user. // 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. * Returns meta data about this system.