Skip to content

Commit

Permalink
more review changesr
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobperia committed Jul 12, 2023
1 parent 70620c4 commit dc0a5f1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/user_deletion.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ Depending on legalities of your application, you can choose from three options:

## User Anonymization and Customization

We have an optional rake task that if setup, anonymizes user records after a period of time. This task calls `AnonymizationService` which strips all columns of the user's data.
We have an optional rake task that if setup, anonymizes user records after a period of time. This task calls [AnonymizationService](../app/services/anonymization_service.rb) which strips all columns of the user's data.

1. Run `rake anonymize:users` to anonymize user records that were discarded a certain number of days ago and have not been anonymized yet. The number of days is stored in a constant called `ANONYMIZE_USER_DATA_AFTER_DAYS` which if set to **0** will anonymize the user record immediately.
1. Run `rake anonymize:users` to anonymize user records that were discarded a certain number of days ago and have not been anonymized yet. The number of days is stored in a constant called [ANONYMIZE\_USER\_DATA\_AFTER_DAYS](../config/initializers/0_constants.rb) which if set to **0** will anonymize the user record immediately.
2. Some fields are set to custom values. For example, `full_name` to **"Deleted User"**, `email` to **"prefix@domain"** where **prefix** and **domain** are customizable and password is set to a secure 60 character **SecureRandom** password.

### IMPORTANT:
If using the anonymizer, don't forget to update the method `anonymize_user` in [AnonymizationService](../app/services/anonymization_service.rb) to clear or randomize any new fields you may add to the **User** record.

## Permanentaly delete a user record

If you'd like to permanentally delete a user record, replace `discard` with `destroy` wherever it is called on a **User** record. The main location where this needs to be replaced is `controllers/registrations_controller.rb` in the **destroy** action.
If you'd like to permanentally delete a user record, replace `discard` with `destroy` wherever it is called on a **User** record. The main location where this needs to be replaced is [registrations_controller.rb](../app/controllers/registrations_controller.rb) in the **destroy** action.

0 comments on commit dc0a5f1

Please sign in to comment.