diff --git a/app/controllers/schemes_controller.rb b/app/controllers/schemes_controller.rb index f1c1382f8..d4168e355 100644 --- a/app/controllers/schemes_controller.rb +++ b/app/controllers/schemes_controller.rb @@ -5,6 +5,7 @@ class SchemesController < ApplicationController before_action :authenticate_user! before_action :find_resource, except: %i[index] before_action :authenticate_scope! + before_action :redirect_if_scheme_confirmed, only: %i[primary_client_group confirm_secondary_client_group secondary_client_group support details] def index redirect_to schemes_organisation_path(current_user.organisation) unless current_user.support? @@ -254,4 +255,8 @@ private render_not_found and return end end + + def redirect_if_scheme_confirmed + redirect_to @scheme if @scheme.confirmed? + end end