ronefel / moodle-mod_googlemeet

Google Meet resource module plugin for Moodle 3.7+
Other
19 stars 15 forks source link

User fields must be covered with a metadata provider #3

Closed ewallah closed 3 years ago

ewallah commented 3 years ago

The table googlemeet_notify_done stores ids of users. This info is considered private and has to be covered with a metadata provider. So you have to provide a way to export and delete this data.

Perhaps there is another way to collect which users were already notified using Moodle core databases.

PHPUnit output:

$ vendor/bin/phpunit --testsuite core_privacy_testsuite
Moodle 3.10+ (Build: 20201204), 32866a1758e4aeee9a04207e480dbc91a4a828be
Php: 7.3.24.3.18.04.1.1, pgsql: 10.15 (Ubuntu 10.15-0ubuntu0.18.04.1), OS: Linux 4.15.0-126-generic x86_64
PHPUnit 8.5.8 by Sebastian Bergmann and contributors.

.............................................................   61 / 1736 (  3%)
.............................................................  122 / 1736 (  7%)
.............................................................  183 / 1736 ( 10%)
.............................................................  244 / 1736 ( 14%)
.............................................................  305 / 1736 ( 17%)
.............................................................  366 / 1736 ( 21%)
.............................................................  427 / 1736 ( 24%)
.............................................................  488 / 1736 ( 28%)
.............................................................  549 / 1736 ( 31%)
.............................................................  610 / 1736 ( 35%)
.............................................................  671 / 1736 ( 38%)
.............................................................  732 / 1736 ( 42%)
.............................................................  793 / 1736 ( 45%)
.............................................................  854 / 1736 ( 49%)
.............................................................  915 / 1736 ( 52%)
.............................................................  976 / 1736 ( 56%)
............................................................. 1037 / 1736 ( 59%)
............................................................. 1098 / 1736 ( 63%)
............................................................. 1159 / 1736 ( 66%)
............................................................. 1220 / 1736 ( 70%)
............................................................. 1281 / 1736 ( 73%)
............................................................. 1342 / 1736 ( 77%)
............................................................. 1403 / 1736 ( 80%)
............................................................. 1464 / 1736 ( 84%)
............................................................. 1525 / 1736 ( 87%)
............................................................. 1586 / 1736 ( 91%)
.................................................F........... 1647 / 1736 ( 94%)
............................................................. 1708 / 1736 ( 98%)
............................                                  1736 / 1736 (100%)

Time: 53.59 seconds, Memory: 197.00 MB

There was 1 failure:

1) provider_testcase::test_table_coverage
The following tables with user fields must be covered with metadata providers:
  - googlemeet_notify_done (userid)

privacy/tests/provider_test.php:327
lib/phpunit/classes/advanced_testcase.php:80

FAILURES!
Tests: 1736, Assertions: 11400, Failures: 1.
ronefel commented 3 years ago

Hi @ewallah

In the “Minutes before” configuration, it can be configured from 0 to 120 minutes before the event starts and, after the event starts, the information that the student was notified is removed from the database. This information remains in the database for a maximum of 2 hours and that is why I did not find it necessary to make it available in a metadata provider.

Still, in this scenario, would I have to implement this provider?

ewallah commented 3 years ago

Hi Rone,

Personally I do not know, I'm not a lawyer.

In Moodle the grade_import_newitem and grade_import_values tables are reported but not exported/deleted because their data is temporary and only used during an import (the content is deleted after a successful, or failed, import). Perhaps Frédéric Massart can explain why this reporting is needed and the export/delete can be skipped.

Anyhow I would update the 'privacy:metadata' string and mention that this plugin only temporarly stores ids of users. Perhaps you could change the field userid into tempid so the Moodle PHPUnit checks do not detect the field.....

ronefel commented 3 years ago

Hi @ewallah

Adjusted provider. See if the test passes now.

ewallah commented 3 years ago

HI Rone,

All tests pass! THX a million.