1
0

roles_controller.rb 453 B

123456789101112131415161718192021
  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