* Fix: #588 リモート保留中ユーザーに関して、サスペンドから戻す操作を削除 * 条件を書く場所を変更 * 各アカウントの画面を調整
This commit is contained in:
parent
0a6e68255f
commit
1b3c0e3fb7
6 changed files with 30 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue