From 435e4e2a309dcb93e0a1eb4387879c48eb26b758 Mon Sep 17 00:00:00 2001 From: Zig Tan Date: Tue, 17 Apr 2018 10:22:04 +0800 Subject: [PATCH] MDL-61568 repository_boxnet: Implement privacy providers --- .../boxnet/classes/privacy/provider.php | 94 +++++++++++++++++++ .../boxnet/lang/en/repository_boxnet.php | 3 +- 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 repository/boxnet/classes/privacy/provider.php diff --git a/repository/boxnet/classes/privacy/provider.php b/repository/boxnet/classes/privacy/provider.php new file mode 100644 index 00000000000..e8703309ceb --- /dev/null +++ b/repository/boxnet/classes/privacy/provider.php @@ -0,0 +1,94 @@ +. + +/** + * Privacy Subsystem implementation for repository_boxnet. + * + * @package repository_boxnet + * @copyright 2018 Zig Tan + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +namespace repository_boxnet\privacy; + +use core_privacy\local\metadata\collection; +use core_privacy\local\request\approved_contextlist; +use core_privacy\local\request\context; +use core_privacy\local\request\contextlist; + +defined('MOODLE_INTERNAL') || die(); + +/** + * Privacy Subsystem for repository_boxnet implementing metadata and plugin providers. + * + * @copyright 2018 Zig Tan + * @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\plugin\provider { + + /** + * Returns meta data about this system. + * + * @param collection $collection The initialised collection to add items to. + * @return collection A listing of user data stored through this system. + */ + public static function get_metadata(collection $collection) : collection { + $collection->add_external_location_link( + 'box.com', + [ + 'query' => 'privacy:metadata:repository_boxnet:query' + ], + 'privacy:metadata:repository_boxnet' + ); + + return $collection; + } + + /** + * Get the list of contexts that contain user information for the specified user. + * + * @param int $userid The user to search. + * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. + */ + public static function get_contexts_for_userid(int $userid) : contextlist { + return new contextlist(); + } + + /** + * Export all user data for the specified user, in the specified contexts. + * + * @param approved_contextlist $contextlist The approved contexts to export information for. + */ + public static function export_user_data(approved_contextlist $contextlist) { + } + + /** + * Delete all data for all users in the specified context. + * + * @param context $context The specific context to delete data for. + */ + public static function delete_data_for_all_users_in_context(\context $context) { + } + + /** + * Delete all user data for the specified user, in the specified contexts. + * + * @param approved_contextlist $contextlist The approved contexts and user information to delete information for. + */ + public static function delete_data_for_user(approved_contextlist $contextlist) { + } + +} diff --git a/repository/boxnet/lang/en/repository_boxnet.php b/repository/boxnet/lang/en/repository_boxnet.php index 82423743141..85f085bc058 100644 --- a/repository/boxnet/lang/en/repository_boxnet.php +++ b/repository/boxnet/lang/en/repository_boxnet.php @@ -40,4 +40,5 @@ $string['saved'] = 'Box data saved'; $string['shareurl'] = 'Share URL'; $string['username'] = 'Username for Box'; $string['warninghttps'] = 'Box requires your website to be using HTTPS in order for the repository to work.'; - +$string['privacy:metadata:repository_boxnet'] = 'The Box repository plugin does not store any personal data, but does transmit user data from Moodle to the remote system.'; +$string['privacy:metadata:repository_boxnet:query'] = 'The Box repository user search text query.';