Browse Source

add before action for confirmed schemes

pull/797/head
Kat 3 years ago
parent
commit
edc66ef379
  1. 5
      app/controllers/schemes_controller.rb

5
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

Loading…
Cancel
Save