FEAT: Allow admin delete user's associated accounts (#29018)

This commit introduces a feature that allows an admin to delete a user's
associated account. After deletion, a log will be recorded in staff
actions.

ref=t/136675
This commit is contained in:
Linca
2024-09-27 20:08:05 +08:00
committed by GitHub
parent e2f3474bc3
commit a1e5796ba1
10 changed files with 133 additions and 2 deletions

View File

@@ -6346,6 +6346,7 @@ en:
tag_group_create: "create tag group"
tag_group_destroy: "delete tag group"
tag_group_change: "change tag group"
delete_associated_accounts: "delete associated accounts"
screened_emails:
title: "Screened Emails"
description: "When someone tries to create a new account, the following email addresses will be checked and the registration will be blocked, or some other action performed."
@@ -6575,6 +6576,9 @@ en:
check_sso:
title: "Reveal SSO payload"
text: "Show"
delete_associated_accounts:
title: "Delete all associated accounts for this user"
text: "Delete associated accounts"
user:
suspend_failed: "Something went wrong suspending this user %{error}"
@@ -6692,6 +6696,7 @@ en:
post_edits_count: "Post Edits"
anonymize: "Anonymize User"
anonymize_confirm: "Are you SURE you want to anonymize this account? This will change the username and email, and reset all profile information."
delete_associated_accounts_confirm: "Are you SURE you want to delete associated accounts from this account? They may not be able to log in."
anonymize_yes: "Yes, anonymize this account"
anonymize_failed: "There was a problem anonymizing the account."
delete: "Delete User"

View File

@@ -162,6 +162,7 @@ Discourse::Application.routes.draw do
put "disable_second_factor"
delete "sso_record"
get "similar-users.json" => "users#similar_users"
put "delete_associated_accounts"
end
get "users/:id.json" => "users#show", :defaults => { format: "json" }
get "users/:id/:username" => "users#show",