Skip to content

Commit

Permalink
Adopt authorize_user! from Placements::Support::ApplicationController
Browse files Browse the repository at this point in the history
  • Loading branch information
Nitemaeric committed Jan 2, 2024
1 parent 6350510 commit 8792a4c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/controllers/claims/support/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
class Claims::Support::ApplicationController < ApplicationController
before_action :authenticate_support_user!
before_action :authenticate_user!, :authorize_user!

private

def authenticate_support_user!
authenticate_user!
def authorize_user!
return if current_user.support_user?

unless current_user.support_user?
redirect_to claims_root_path, alert: "You cannot perform this action"
end
redirect_to claims_root_path, alert: "You cannot perform this action"
end
end

0 comments on commit 8792a4c

Please sign in to comment.