diff --git a/app/controllers/admin/editors_controller.rb b/app/controllers/admin/editors_controller.rb index 57cbeb7cf..1fa9c3fe1 100644 --- a/app/controllers/admin/editors_controller.rb +++ b/app/controllers/admin/editors_controller.rb @@ -24,10 +24,10 @@ def update private def editor_update_params - params.require(:editor).permit( - :name, - :form_uids, - :copy_token + params.expect( + editor: %i[name + form_uids + copy_token] ).tap do |whitelisted| whitelisted[:form_uids] = (whitelisted[:form_uids] || '').split(',').map(&:strip) end diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 0ce3d2be3..139b8dae1 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -38,6 +38,6 @@ def stop_impersonating private def user_params - params.require(:user).permit(:editor_id) + params.expect(user: [:editor_id]) end end diff --git a/app/controllers/concerns/prolong_token_wizard_management.rb b/app/controllers/concerns/prolong_token_wizard_management.rb index 396332f6a..b4d3bab57 100644 --- a/app/controllers/concerns/prolong_token_wizard_management.rb +++ b/app/controllers/concerns/prolong_token_wizard_management.rb @@ -58,6 +58,6 @@ def find_prolong_token_wizard end def prolong_token_wizard_params - params.require(:prolong_token_wizard).permit(:owner, :project_purpose, :contact_metier, :contact_technique) + params.expect(prolong_token_wizard: %i[owner project_purpose contact_metier contact_technique]) end end diff --git a/app/models/user.rb b/app/models/user.rb index 26da17fc2..04d381d6a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -69,7 +69,7 @@ def editor? def admin? if Rails.env.production? Rails.application.credentials.admin_emails.include?(email) - elsif Rails.env.development? + elsif Rails.env.development? || Rails.env.staging? %w[ api-entreprise@yopmail.com api-particulier@yopmail.com