闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
453 B

  1. # frozen_string_literal: true
  2. module Admin
  3. class RolesController < BaseController
  4. before_action :set_user
  5. def promote
  6. authorize @user, :promote?
  7. @user.promote!
  8. log_action :promote, @user
  9. redirect_to admin_account_path(@user.account_id)
  10. end
  11. def demote
  12. authorize @user, :demote?
  13. @user.demote!
  14. log_action :demote, @user
  15. redirect_to admin_account_path(@user.account_id)
  16. end
  17. end
  18. end