From 04f1d5ee198e1419dc18f2307b3caa84929c8fdb Mon Sep 17 00:00:00 2001 From: Daniel Dye Date: Tue, 2 Jan 2024 12:46:40 +0000 Subject: [PATCH] Adopt authorize_user! from Placements::Support::ApplicationController --- .../claims/support/application_controller.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/controllers/claims/support/application_controller.rb b/app/controllers/claims/support/application_controller.rb index da0e6fcfb1..008133f15e 100644 --- a/app/controllers/claims/support/application_controller.rb +++ b/app/controllers/claims/support/application_controller.rb @@ -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