agdsn / pycroft

The AG DSN management system
Apache License 2.0
21 stars 9 forks source link

User Deletion #67

Open lukasjuhrich opened 7 years ago

lukasjuhrich commented 7 years ago

We should think about a procedure to delete users. The unix_account might be considered independent of this question.


Related Tasks:

lukasjuhrich commented 5 years ago

This touches the following behaviors:

Use Case: User moves out continuing use of services

Use Case: User moves out without continuing use of services having nonzero balance

When moving out, the following follow-up action should be considered:

Use Case: Closing of finance account

Use Case: limitation of claim („Verjährung“)

Unclear: How to deal with former admins

A lot of management entities like logentries or an MT940Error reference a processor. It is unclear how that should be handled when the former admin e.g. demands deletion of his/her data.

Possible realization of „archiving“

One could consider splitting up an ArchivedUser from a User both inheriting from an AbstractUser (RIP naming) following the following criteria:

Depending on the technical details, we could possibly drop the sibling construction and opt for a parent-child construction ProFormaUser←User – „archiving“ would the mean dropping the polymorphic User identity of a ProFormaUser.

lukasjuhrich commented 4 years ago

We want the following three-step model:

  1. Marking a user for deletion by adding them to a „to be deleted“ group, which can deny all properties
  2. „Archiving“ the user: Removing all log entries, Tasks, and Hosts (but not memberships, unixAccount and Finance data!)
  3. Removing the user either 10 years after EOMembership or when the account is balanced.
Lodifice commented 4 years ago

Regarding 3: whatever is later?

lukasjuhrich commented 3 years ago

Yes, whatever is later. We want that both conditions are met (10y have passed + account balanced).

lukasjuhrich commented 3 years ago

The purposes of the suggested phases would be:

  1. Enabling a confirmation step before irreversible things happen
  2. Deleting as much data as possible while retaining what we need for backing up financial claims && membership data
  3. Deleting everything when the requirements drop.

It's not clear what 1. means however. The risk factors basically are:

A benefit of decoupling 1. from 2. is that one can easily intervene manually by removing / adding the “to be deleted” membership. Another question would be if realizing that with a membership wouldn't be overkill.

A last question would be: Do we want a manual audit mechanism for the users that are marked as “to be deleted”?

lukasjuhrich commented 3 years ago

The big, big question is what the qualifier for marking for deletion should be.

  1. User.room is None would match too much, because (often active) members not living in a dorm anymore might be deleted
  2. User.room is None and not User.hosts also matches too much for the same reason
  3. User.room is None && there are no active group memberships finds too few users, because that does not catch cases where a user has e.g. been exempted from payments, and hence has one unbounded membership

Perhaps we should add a property keep_in_system to groups like Aktiv, Exaktiv, Mitglied, which we can do to augment variant 2?

ibot3 commented 3 years ago
  1. User.room is None && there are no active group memberships finds too few users, because that does not catch cases where a user has e.g. been exempted from payments, and hence has one unbounded membership

But the users that have a negative balance (and therefore may have the Zahlungsrückstand group) shouldn't be deleted anyways or only at a later point (maybe 5 years?

lukasjuhrich commented 3 years ago

The proposed lifecycle for users who have a negative balance would be:

  1. Once they are not a member anymore (and are not „kept alive“ by some other qualifier such as „using services“ etc), they will be tagged as to-be-archived via some membership
  2. After a lenience period (say half a year), the user will be archived in the sense of step two mentioned above. Finance and membership data will still exist.
  3. At the latest ten years after EOMembership the data could be deleted, since due to §195 BGB the monetary claim vanishes after 3 years, and keeping the data for ten years is required by §147 AO (3).

I'm not quite clear over whether we actually need to keep the membership data for that long. Probably though, because it provides the basis for the monetary claims.

ibot3 commented 3 years ago

After a lenience period (say half a year), the user will be archived

There is already a fixed date for this: At the end of the next year that follows the EoM.

Example: Membership ends on 2021-07-01: Archiving will be done on 2023-01-01 Membership ends on 2022-01-01: Archiving will be done on 2024-01-01

lukasjuhrich commented 3 years ago

An important suggestion raised by @marcelb98: in the deletion process, we might want to give a PDF-printout of all the user-ids (+ corresponding logins) that have been deleted so that we know which of the paper forms can be destroyed. Note that some of the oldest forms did not even have a user-id printed on it, which is why we require a login.

As to not create any more unneccessary digital data, we should not retain that information digitally and print it out + add it to the binders with the membership info.

If there would be a way to avoid the login information that would be great; in that case, we might even go for an alternative workflow and just look which user ids are still in the membership table. We can obtain that estimate when doing the initial archiving and selecting for people who don't have the archived property. I wouldn't expect a lot of people (hence user-ids) to be left.

ibot3 commented 3 years ago

I don't know the current status, but I remember that the user-ids were added to the printed forms afterwards. But I could also be wrong, so we should just take a look at some old forms at the office.

lukasjuhrich commented 1 year ago

Subtasks:

The last thing should be trivial as it should just delete users having the deleted flag: in phase 2 a „deleted“ membership should be added proactively.