diff --git a/app/controllers/locations_controller.rb b/app/controllers/locations_controller.rb index b84185b51..2a254bfa3 100644 --- a/app/controllers/locations_controller.rb +++ b/app/controllers/locations_controller.rb @@ -230,6 +230,8 @@ class LocationsController < ApplicationController end end + def delete; end + private def authorize_user diff --git a/app/policies/location_policy.rb b/app/policies/location_policy.rb index 5d6d6d467..5371df19e 100644 --- a/app/policies/location_policy.rb +++ b/app/policies/location_policy.rb @@ -26,6 +26,14 @@ class LocationPolicy user.data_coordinator? && scheme_owned_by_user_org_or_stock_owner end + def delete_confirmation? + user.support? + end + + def delete? + user.support? + end + %w[ update_postcode? update_local_authority? diff --git a/app/views/locations/delete_confirmation.html.erb b/app/views/locations/delete_confirmation.html.erb new file mode 100644 index 000000000..0eea3adc8 --- /dev/null +++ b/app/views/locations/delete_confirmation.html.erb @@ -0,0 +1,24 @@ +<% content_for :before_content do %> + <% content_for :title, "Are you sure you want to delete this location?" %> + <%= govuk_back_link(href: :back) %> +<% end %> + +