]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/nodes_controller.rb
Move the api methods from changeset_comments_controller into the api namespaced contr...
[rails.git] / app / controllers / nodes_controller.rb
index baa6d8195abd92491f57d3e1794d6adeb119ab30..6c1d66db4c1dd9edb078e07103640d3341b120d1 100644 (file)
@@ -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)