user policy to allow profile edits
This commit is contained in:
@ -2,14 +2,17 @@
|
||||
module Admin
|
||||
class ProfileController < AdminController
|
||||
def view
|
||||
authorize current_user
|
||||
end
|
||||
|
||||
def edit
|
||||
@user = current_user
|
||||
authorize @user
|
||||
end
|
||||
|
||||
def update
|
||||
@user = current_user
|
||||
authorize @user
|
||||
|
||||
if @user.update_attributes(user_params)
|
||||
redirect_to admin_profile_path,
|
||||
|
@ -4,8 +4,8 @@ class AdminController < ApplicationController
|
||||
layout 'admin'
|
||||
before_action :authorize_user
|
||||
|
||||
# TODO: after_action :verify_authorized, except: :index
|
||||
# TODO: after_action :verify_policy_scoped, only: :index
|
||||
# after_action :verify_authorized, except: :index
|
||||
# after_action :verify_policy_scoped, only: :index
|
||||
|
||||
rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized
|
||||
|
||||
|
Reference in New Issue
Block a user