diff --git a/app/controllers/new_administrateur/procedures_controller.rb b/app/controllers/new_administrateur/procedures_controller.rb index 7a2169656..8b2c0431d 100644 --- a/app/controllers/new_administrateur/procedures_controller.rb +++ b/app/controllers/new_administrateur/procedures_controller.rb @@ -1,6 +1,6 @@ module NewAdministrateur class ProceduresController < AdministrateurController - before_action :retrieve_procedure, only: [:champs, :annotations, :edit, :monavis, :update_monavis, :jeton, :update_jeton, :publication, :publish, :transfert, :allow_expert_review, :invited_expert_list] + before_action :retrieve_procedure, only: [:champs, :annotations, :edit, :monavis, :update_monavis, :jeton, :update_jeton, :publication, :publish, :transfert, :allow_expert_review, :invited_expert_list, :update_allow_decision_access] before_action :procedure_locked?, only: [:champs, :annotations] ITEMS_PER_PAGE = 25 @@ -189,6 +189,13 @@ module NewAdministrateur @experts_procedure = @procedure.experts_procedures.sort_by { |expert_procedure| expert_procedure.expert.email } end + def update_allow_decision_access + @procedure + .experts_procedures + .find(params[:expert_procedure]) + .update!(allow_decision_access_params) + end + private def apercu_tab @@ -215,5 +222,9 @@ module NewAdministrateur def publish_params params.permit(:path, :lien_site_web) end + + def allow_decision_access_params + params.require(:experts_procedure).permit(:allow_decision_access) + end end end diff --git a/config/routes.rb b/config/routes.rb index f9a9f8131..f3117b72b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -379,13 +379,14 @@ Rails.application.routes.draw do get 'jeton' patch 'update_jeton' put :allow_expert_review - get 'invited_expert_list' end get 'publication' => 'procedures#publication', as: :publication put 'publish' => 'procedures#publish', as: :publish get 'transfert' => 'procedures#transfert', as: :transfert post 'transfer' => 'procedures#transfer', as: :transfer + get 'invited_expert_list' + put 'update_allow_decision_access' => 'procedures#update_allow_decision_access', as: :update_allow_decision_access resources :mail_templates, only: [:edit, :update]