Skip to content

feat: add GDPR user deletion for staff console#581

Open
Joe-Heffer-Shef wants to merge 4 commits into
mainfrom
570-ability-to-remove-a-user-entirely-for-gdpr
Open

feat: add GDPR user deletion for staff console#581
Joe-Heffer-Shef wants to merge 4 commits into
mainfrom
570-ability-to-remove-a-user-entirely-for-gdpr

Conversation

@Joe-Heffer-Shef

@Joe-Heffer-Shef Joe-Heffer-Shef commented Apr 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds UserService.anonymise_user which wipes PII (name, email, password), deactivates the account, and removes all organisation memberships — satisfying GDPR right-to-erasure requests
  • Adds a ConsoleDeleteUserView (GET confirmation page + POST action) accessible only to staff; protected against deleting self, other staff, or superusers
  • Links a Delete user button from the user detail page when the target is an active, non-staff, non-self account

Test plan

  • Staff user visits a regular user's detail page and sees the Delete user button
  • Confirmation page shows the user's name/email and a clear warning
  • After confirming, the user is deactivated, PII is wiped, and they are removed from all organisations
  • Attempting to delete self, a staff account, or a superuser returns 403
  • Regular (non-staff) users cannot access the delete URL
  • Anonymous users are redirected to login

🤖 Generated with Claude Code

Adds a `UserService.anonymise_user` method that wipes PII (name, email,
password), deactivates the account, and removes all organisation
memberships. Staff can trigger this from a new confirmation page linked
from the user detail view.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Joe-Heffer-Shef Joe-Heffer-Shef linked an issue Apr 22, 2026 that may be closed by this pull request
@Joe-Heffer-Shef Joe-Heffer-Shef self-assigned this Apr 22, 2026
@Joe-Heffer-Shef

Copy link
Copy Markdown
Collaborator Author

@Joe-Heffer-Shef Joe-Heffer-Shef enabled auto-merge (squash) June 5, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to remove a user entirely (for GDPR)

1 participant