From 7a32099e26c522ef5588f844d6c1d0471c57e1ff Mon Sep 17 00:00:00 2001 From: JG Date: Thu, 30 Jun 2022 11:27:43 +0100 Subject: [PATCH] location controller --- app/controllers/locations_controller.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 app/controllers/locations_controller.rb diff --git a/app/controllers/locations_controller.rb b/app/controllers/locations_controller.rb new file mode 100644 index 000000000..9ba609424 --- /dev/null +++ b/app/controllers/locations_controller.rb @@ -0,0 +1,14 @@ +class LocationsController < ApplicationController + before_action :authenticate_user! + before_action :authenticate_scope! + + def new + @location = Location.new + end + +private + + def authenticate_scope! + head :unauthorized and return unless current_user.data_coordinator? || current_user.support? + end +end