Skip to content

Commit c2c9754

Browse files
committed
fix : issue 78 failing privacy provider test. adding method delete_data_for_users
1 parent 3b0872d commit c2c9754

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

classes/privacy/provider.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,13 @@ public static function _delete_data_for_user(approved_contextlist $contextlist)
248248
$records->close();
249249
}
250250
}
251+
252+
/**
253+
* Get the list of users within a specific context.
254+
* @param userlist $userlist The userlist containing the list of users who have data in this context/plugin combination.
255+
* @return void
256+
*/
251257
public static function get_users_in_context(userlist $userlist) {
252-
// TODO: Implement get_users_in_context() method.
253258
$context = $userlist->get_context();
254259
if(!$context instanceof \context_user) {
255260
return;
@@ -274,7 +279,16 @@ public static function get_users_in_context(userlist $userlist) {
274279

275280
}
276281

282+
/**
283+
* Delete multiple users within a single context.
284+
* @param approved_userlist $userlist The approved context and user information to delete information for.
285+
* @return void
286+
*/
277287
public static function delete_data_for_users(approved_userlist $userlist) {
278-
// TODO: Implement delete_data_for_users() method.
288+
$context = $userlist->get_context();
289+
290+
if ($context instanceof \context_user) {
291+
static::_delete_data_for_user($context->instanceid);
292+
}
279293
}
280294
}

0 commit comments

Comments
 (0)