Add option to keep evidence when suspending accounts

Fix #547

When selected, before the account's data is removed, some of it
is denormalized into a separate, symmetrically-encrypted table. In
particular:

- The e-mail
- All IPs used to access the account
- SHA256 fingerprints of all uploaded files
- URIs of accounts followed by or following the account
- URIs of accounts that were invited
This commit is contained in:
Eugen Rochko 2020-01-12 19:42:24 +01:00
parent 3a6f9860fc
commit 7bf27db007
15 changed files with 234 additions and 9 deletions

View file

@ -19,7 +19,10 @@ class Admin::AccountAction
:report_id,
:warning_preset_id
attr_reader :warning, :send_email_notification, :include_statuses
attr_reader :warning,
:send_email_notification,
:include_statuses,
:create_account_summary
def send_email_notification=(value)
@send_email_notification = ActiveModel::Type::Boolean.new.cast(value)
@ -29,6 +32,10 @@ class Admin::AccountAction
@include_statuses = ActiveModel::Type::Boolean.new.cast(value)
end
def create_account_summary=(value)
@create_account_summary = ActiveModel::Type::Boolean.new.cast(value)
end
def save!
ApplicationRecord.transaction do
process_action!
@ -138,7 +145,7 @@ class Admin::AccountAction
end
def queue_suspension_worker!
Admin::SuspensionWorker.perform_async(target_account.id)
Admin::SuspensionWorker.perform_async(target_account.id, summarize_account: create_account_summary)
end
def process_queue!