Add restriction on User's URL based on Dossier state

This commit is contained in:
Xavier J 2016-01-25 15:54:21 +01:00
parent 0c2bbc482f
commit c1ea10bd82
13 changed files with 376 additions and 18 deletions

View file

@ -1,14 +1,11 @@
class Users::CarteController < UsersController
include DossierConcern
before_action :authorized_routes?, only: [:show]
def show
@dossier = current_user_dossier
unless @dossier.procedure.module_api_carto.use_api_carto
flash.alert = t('errors.messages.dossier_map_not_activated')
redirect_to url_for(root_path)
end
rescue ActiveRecord::RecordNotFound
flash.alert = t('errors.messages.dossier_not_found')
redirect_to url_for(root_path)

View file

@ -1,4 +1,6 @@
class Users::DescriptionController < UsersController
before_action :authorized_routes?, only: [:show]
def show
@dossier = current_user_dossier
@dossier = @dossier.decorate

View file

@ -5,6 +5,8 @@ class Users::DossiersController < UsersController
before_action :authenticate_user!
before_action :check_siret, only: :create
before_action :authorized_routes?, only: [:show]
def index
order = 'DESC'
@ -152,7 +154,6 @@ class Users::DossiersController < UsersController
def error_procedure
flash.alert = t('errors.messages.procedure_not_found')
redirect_to url_for users_dossiers_path
end

View file

@ -1,4 +1,6 @@
class Users::RecapitulatifController < UsersController
before_action :authorized_routes?, only: [:show]
def show
create_dossier_facade
end