pundit: convert users to pundit.
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
module Admin
|
||||
class UsersController < ApplicationController
|
||||
before_action :moderator_only
|
||||
|
||||
def edit
|
||||
@user = User.find(params[:id])
|
||||
@user = authorize User.find(params[:id]), :promote?
|
||||
end
|
||||
|
||||
def update
|
||||
@user = User.find(params[:id])
|
||||
@user = authorize User.find(params[:id]), :promote?
|
||||
@user.promote_to!(params[:user][:level], params[:user])
|
||||
redirect_to edit_admin_user_path(@user), :notice => "User updated"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user