Add account sensitized (#14361)
* Add account sensitized * Fix i18n normalize * Fix description and spec * Fix spec * Fix wording
This commit is contained in:
@ -8,6 +8,7 @@ class Admin::AccountAction
|
||||
TYPES = %w(
|
||||
none
|
||||
disable
|
||||
sensitive
|
||||
silence
|
||||
suspend
|
||||
).freeze
|
||||
@ -64,6 +65,8 @@ class Admin::AccountAction
|
||||
case type
|
||||
when 'disable'
|
||||
handle_disable!
|
||||
when 'sensitive'
|
||||
handle_sensitive!
|
||||
when 'silence'
|
||||
handle_silence!
|
||||
when 'suspend'
|
||||
@ -109,6 +112,12 @@ class Admin::AccountAction
|
||||
target_account.user&.disable!
|
||||
end
|
||||
|
||||
def handle_sensitive!
|
||||
authorize(target_account, :sensitive?)
|
||||
log_action(:sensitive, target_account)
|
||||
target_account.sensitize!
|
||||
end
|
||||
|
||||
def handle_silence!
|
||||
authorize(target_account, :silence?)
|
||||
log_action(:silence, target_account)
|
||||
|
Reference in New Issue
Block a user