MDL-63552 search_solr: Add support for removal of context users
authorMichael Hawkins <michaelh@moodle.com>
Mon, 15 Oct 2018 06:00:07 +0000 (14:00 +0800)
committerMichael Hawkins <michaelh@moodle.com>
Thu, 25 Oct 2018 03:41:08 +0000 (11:41 +0800)
This issue is a part of the MDL-62560 Epic.

search/engine/solr/classes/privacy/provider.php

index f2208ce..7475b9e 100644 (file)
@@ -28,6 +28,8 @@ 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\request\approved_userlist;
+use core_privacy\local\request\userlist;
 
 /**
  * Provider for the search_solr plugin.
@@ -36,9 +38,12 @@ use core_privacy\local\request\approved_contextlist;
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 class provider implements
-    // This search engine plugin does not store any data itself.
-    // It has no database tables, and it purely acts as a conduit, sending data externally.
-    \core_privacy\local\metadata\provider, \core_privacy\local\request\plugin\provider {
+        // This search engine plugin does not store any data itself.
+        // It has no database tables, and it purely acts as a conduit, sending data externally.
+        // This plugin is capable of determining which users have data within it.
+        \core_privacy\local\metadata\provider,
+        \core_privacy\local\request\core_userlist_provider,
+        \core_privacy\local\request\plugin\provider {
 
     /**
      * Returns meta data about this system.
@@ -61,6 +66,14 @@ class provider implements
         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) {
+    }
+
     /**
      * Export all user data for the specified user, in the specified contexts.
      *
@@ -84,4 +97,12 @@ class provider implements
      */
     public static function delete_data_for_user(approved_contextlist $contextlist) {
     }
+
+    /**
+     * 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) {
+    }
 }