Merge pull request #9853 from mfo/US/fix-expert-link-to-dossiers

ETQ expert: lorsque je me connecte, je suis redirigé vers la page des avis, non pas vers la page de mes dossiers
This commit is contained in:
Colin Darie 2023-12-14 19:52:32 +00:00 committed by GitHub
commit 9a5d908851
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 4 deletions

View file

@ -200,6 +200,7 @@ class ApplicationController < ActionController::Base
roles = [
current_user,
current_instructeur,
current_expert,
current_administrateur,
current_gestionnaire,
current_super_admin

View file

@ -6,6 +6,8 @@ class RootController < ApplicationController
return redirect_to admin_procedures_path
elsif instructeur_signed_in?
return redirect_to instructeur_procedures_path
elsif expert_signed_in?
return redirect_to expert_all_avis_path
elsif user_signed_in?
return redirect_to dossiers_path
elsif super_admin_signed_in?

View file

@ -1,5 +1,7 @@
class TargetedUserLinksController < ApplicationController
def show
erase_user_location!
store_user_location! if !user_signed_in?
if targeted_user_link.invalid_signed_in_user?(current_user)
render
else
@ -11,6 +13,14 @@ class TargetedUserLinksController < ApplicationController
private
def store_user_location!
store_location_for(:user, request.fullpath)
end
def erase_user_location!
clear_stored_location_for(:user)
end
def targeted_user_link
@targeted_user_link ||= TargetedUserLink.find(params[:id])
end