X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/6ca22de4f2c68e4b14a6e2f0938a8657c33adc31..947a41edee95df9e75cce0452277e2a00a8b5fa5:/app/controllers/nodes_controller.rb diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb index baa6d8195..6c1d66db4 100644 --- a/app/controllers/nodes_controller.rb +++ b/app/controllers/nodes_controller.rb @@ -5,7 +5,10 @@ class NodesController < ApplicationController skip_before_action :verify_authenticity_token before_action :authorize, :only => [:create, :update, :delete] - before_action :require_allow_write_api, :only => [:create, :update, :delete] + before_action :api_deny_access_handler + + authorize_resource + before_action :require_public_data, :only => [:create, :update, :delete] before_action :check_api_writable, :only => [:create, :update, :delete] before_action :check_api_readable, :except => [:create, :update, :delete] @@ -23,7 +26,7 @@ class NodesController < ApplicationController end # Dump the details on a node given in params[:id] - def read + def show node = Node.find(params[:id]) response.last_modified = node.timestamp @@ -60,7 +63,7 @@ class NodesController < ApplicationController end # Dump the details on many nodes whose ids are given in the "nodes" parameter. - def nodes + def index raise OSM::APIBadUserInput, "The parameter nodes is required, and must be of the form nodes=id[,id[,id...]]" unless params["nodes"] ids = params["nodes"].split(",").collect(&:to_i)