logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

suspensions_controller.rb (581B)


  1. # frozen_string_literal: true
  2. module Admin
  3. class SuspensionsController < BaseController
  4. before_action :set_account
  5. def create
  6. authorize @account, :suspend?
  7. Admin::SuspensionWorker.perform_async(@account.id)
  8. log_action :suspend, @account
  9. redirect_to admin_accounts_path
  10. end
  11. def destroy
  12. authorize @account, :unsuspend?
  13. @account.unsuspend!
  14. log_action :unsuspend, @account
  15. redirect_to admin_accounts_path
  16. end
  17. private
  18. def set_account
  19. @account = Account.find(params[:account_id])
  20. end
  21. end
  22. end