Fix: #588 リモート保留中ユーザーに関して、サスペンドから戻す操作を削除 (#589)

* Fix: #588 リモート保留中ユーザーに関して、サスペンドから戻す操作を削除

* 条件を書く場所を変更

* 各アカウントの画面を調整
This commit is contained in:
KMY(雪あすか) 2024-02-18 08:37:22 +09:00 committed by GitHub
parent 0a6e68255f
commit 1b3c0e3fb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 30 additions and 4 deletions

View file

@ -3,7 +3,7 @@
module Admin
class AccountsController < BaseController
before_action :set_account, except: [:index, :batch]
before_action :require_remote_account!, only: [:redownload]
before_action :require_remote_account!, only: [:redownload, :approve_remote, :reject_remote]
before_action :require_local_account!, only: [:enable, :memorialize, :approve, :reject]
def index
@ -66,6 +66,20 @@ module Admin
redirect_to admin_accounts_path(status: 'pending'), notice: I18n.t('admin.accounts.rejected_msg', username: @account.acct)
end
def approve_remote
authorize @account, :approve_remote?
@account.approve_remote!
log_action :approve_remote, @account
redirect_to admin_account_path(@account.id), notice: I18n.t('admin.accounts.approved_msg', username: @account.acct)
end
def reject_remote
authorize @account, :reject_remote?
@account.reject_remote!
log_action :reject_remote, @account
redirect_to admin_account_path(@account.id), notice: I18n.t('admin.accounts.rejected_msg', username: @account.acct)
end
def destroy
authorize @account, :destroy?
Admin::AccountDeletionWorker.perform_async(@account.id)