Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.
   1  <?php
   2  // This file is part of Moodle - http://moodle.org/
   3  //
   4  // Moodle is free software: you can redistribute it and/or modify
   5  // it under the terms of the GNU General Public License as published by
   6  // the Free Software Foundation, either version 3 of the License, or
   7  // (at your option) any later version.
   8  //
   9  // Moodle is distributed in the hope that it will be useful,
  10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12  // GNU General Public License for more details.
  13  //
  14  // You should have received a copy of the GNU General Public License
  15  // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
  16  
  17  /**
  18   * Data provider.
  19   *
  20   * @package    core_fileconverter
  21   * @copyright  2018 Frédéric Massart
  22   * @author     Frédéric Massart <fred@branchup.tech>
  23   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  24   */
  25  
  26  namespace core_fileconverter\privacy;
  27  defined('MOODLE_INTERNAL') || die();
  28  
  29  use context;
  30  use core_privacy\local\metadata\collection;
  31  use core_privacy\local\request\approved_contextlist;
  32  use core_privacy\local\request\userlist;
  33  use core_privacy\local\request\approved_userlist;
  34  
  35  /**
  36   * Data provider class.
  37   *
  38   * @package    core_fileconverter
  39   * @copyright  2018 Frédéric Massart
  40   * @author     Frédéric Massart <fred@branchup.tech>
  41   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  42   */
  43  class provider implements
  44          \core_privacy\local\metadata\provider,
  45          \core_privacy\local\request\core_userlist_provider,
  46          \core_privacy\local\request\subsystem\provider {
  47  
  48      /**
  49       * Returns metadata.
  50       *
  51       * @param collection $collection The initialised collection to add items to.
  52       * @return collection A listing of user data stored through this system.
  53       */
  54      public static function get_metadata(collection $collection) : collection {
  55          $collection->add_plugintype_link('fileconverter', [], 'privacy:metadata:plugintypefileconverter');
  56          return $collection;
  57      }
  58  
  59      /**
  60       * Get the list of contexts that contain user information for the specified user.
  61       *
  62       * @param int $userid The user to search.
  63       * @return \contextlist $contextlist The contextlist containing the list of contexts used in this plugin.
  64       */
  65      public static function get_contexts_for_userid(int $userid) : \core_privacy\local\request\contextlist {
  66          // We cannot associate files with a particular user as it would require to know all the details about
  67          // the source file, which only the component owning it knows about. And, the 'usermodified' attribute
  68          // of the conversion class is not an identifier of data ownership, merely that this user was logged in
  69          // when the conversion was requested. As such, as the owning component should declare the source file,
  70          // and we can't make sense of 'usermodified', we will not be reporting anything here. Also note that
  71          // the clean up task will ensure that whenever a source file is delete, its conversions also are.
  72          return new \core_privacy\local\request\contextlist();
  73      }
  74  
  75      /**
  76       * Get the list of users who have data within a context.
  77       *
  78       * @param userlist $userlist The userlist containing the list of users who have data in this context/plugin combination.
  79       */
  80      public static function get_users_in_context(userlist $userlist) {
  81      }
  82  
  83      /**
  84       * Export all user data for the specified user, in the specified contexts.
  85       *
  86       * @param approved_contextlist $contextlist The approved contexts to export information for.
  87       */
  88      public static function export_user_data(approved_contextlist $contextlist) {
  89      }
  90  
  91      /**
  92       * Delete all data for all users in the specified context.
  93       *
  94       * @param context $context The specific context to delete data for.
  95       */
  96      public static function delete_data_for_all_users_in_context(context $context) {
  97      }
  98  
  99      /**
 100       * Delete multiple users within a single context.
 101       *
 102       * @param approved_userlist $userlist The approved context and user information to delete information for.
 103       */
 104      public static function delete_data_for_users(approved_userlist $userlist) {
 105      }
 106  
 107      /**
 108       * Delete all user data for the specified user, in the specified contexts.
 109       *
 110       * @param approved_contextlist $contextlist The approved contexts and user information to delete information for.
 111       */
 112      public static function delete_data_for_user(approved_contextlist $contextlist) {
 113      }
 114  
 115  }