diff --git a/config/application.rb b/config/application.rb index 50576fe28..90bf6cd38 100644 --- a/config/application.rb +++ b/config/application.rb @@ -36,6 +36,9 @@ module Consul # in any CONSUL installations config.active_support.use_authenticated_message_encryption = false + # Handle custom exceptions + config.action_dispatch.rescue_responses["FeatureFlags::FeatureDisabled"] = :forbidden + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # config.time_zone = 'Central Time (US & Canada)' diff --git a/public/403.html b/public/403.html new file mode 100644 index 000000000..7c0b688ef --- /dev/null +++ b/public/403.html @@ -0,0 +1,41 @@ + + + + Error 403 | Forbidden: Access disabled + + + + + +
+

403

+

Access to this page has been disabled by the administrators.

+
+ + diff --git a/spec/system/admin/feature_flags_spec.rb b/spec/system/admin/feature_flags_spec.rb index c114b87e0..5fd48a934 100644 --- a/spec/system/admin/feature_flags_spec.rb +++ b/spec/system/admin/feature_flags_spec.rb @@ -36,12 +36,12 @@ describe "Admin feature flags", :admin do visit budget_path(budget) - expect(page).to have_content "Internal server error" + expect(page).to have_title "Forbidden" visit admin_budgets_path expect(page).to have_current_path admin_budgets_path - expect(page).to have_content "Internal server error" + expect(page).to have_title "Forbidden" end scenario "Enable a disabled participatory process" do