|
|
@ -5,6 +5,7 @@ class SchemesController < ApplicationController |
|
|
|
before_action :authenticate_user! |
|
|
|
before_action :authenticate_user! |
|
|
|
before_action :find_resource, except: %i[index] |
|
|
|
before_action :find_resource, except: %i[index] |
|
|
|
before_action :authenticate_scope! |
|
|
|
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 |
|
|
|
def index |
|
|
|
redirect_to schemes_organisation_path(current_user.organisation) unless current_user.support? |
|
|
|
redirect_to schemes_organisation_path(current_user.organisation) unless current_user.support? |
|
|
@ -254,4 +255,8 @@ private |
|
|
|
render_not_found and return |
|
|
|
render_not_found and return |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def redirect_if_scheme_confirmed |
|
|
|
|
|
|
|
redirect_to @scheme if @scheme.confirmed? |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|