-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anonymize patron data #6503
Anonymize patron data #6503
Conversation
- Adds "Anonymize Account" button to `/admin/people` view - Adds CommonExtras update and delete by username functions - Adds anonymize function to Account, which updates OL tables in test mode
- Remove patron from all usergroups - Reset preferences to default - Clear patron's User data - Set type to `/type/delete`
Keeping this in draft, as it doesn't yet address some things:
|
Add dialog or something to confirm action. Also, maybe change the location of the button to avoid misclicks. |
- Move anonymization button to admin history table - Add confimation dialog for anonymization
Running into issues anonymizing keys, which is how we planned on anonymizing lists and edit history. If it turns out that changes keys is not possible, maybe it would be best to change ownership of lists and history to a dummy account the represents anonymized patrons? Either way, suggest adding this functionality in a PR to be opened in the near future. |
<script> | ||
function confirmAnonymize(event) { | ||
if(!confirm('Really anonymize this patron? This will delete the patron\'s profile page and booknotes, and anonymize the patron\'s reading log, reviews, and star ratings.')) { | ||
event.preventDefault() | ||
} | ||
} | ||
</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're happy with the confirmation dialog approach, I can move this inline JS to a .js
file.
- Adds "Dry run" checkbox next to anonymize button - When "Dry run" is checked, changes to the account are not persisted - Adds patron's display name to confirmation dialog
- Preferences now updated correctly - Patrons redirected to deleted profile page when viewing anonymized reading log page
Today's changes:
|
<form method="POST" id="anonymize-form" action="?debug=true"> | ||
<input type="checkbox" id="dry-run-checkbox" name="dry_run"> | ||
<label for="dry-run-checkbox">Dry Run</label> | ||
<button type="submit" name="action" value="anonymize_account" style="float: right;" class="account-anonymization-button" data-display-name="$person.username">$_("Anonymize Account")</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inline styles?
Closes: #4875, #6455, #5014
Creates the means for an admin to anonymize a patron's account. This PR can be moved from draft when the following tasks are complete:
/admin/people
viewtest
flag for anonymize function (no updates/deletions are committed whiletest
is true)Technical
The
/admin/people/view.html
template was producing invalid HTML. The initial commit of this PR solely addresses those issues.Important Note: If the anonymization process throws an error before it completes we can re-run, but some operations may not be possible during the re-run. This may result in some lingering records.
Testing
Screenshot
New button in
/admin/people
.Flash message that is displayed on success
Stakeholders
@mekarpeles