X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/70d6880e10881dfd4b68f51cf16609a9f8aaff24..35a2d66e1960b00e5ed0cecbe4263cdeedb1ad62:/app/controllers/ways_controller.rb diff --git a/app/controllers/ways_controller.rb b/app/controllers/ways_controller.rb index 39129ebf3..caf787105 100644 --- a/app/controllers/ways_controller.rb +++ b/app/controllers/ways_controller.rb @@ -3,7 +3,10 @@ class WaysController < 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] @@ -19,7 +22,7 @@ class WaysController < ApplicationController render :plain => way.id.to_s end - def read + def show way = Way.find(params[:id]) response.last_modified = way.timestamp @@ -79,7 +82,7 @@ class WaysController < ApplicationController end end - def ways + def index unless params["ways"] raise OSM::APIBadUserInput, "The parameter ways is required, and must be of the form ways=id[,id[,id...]]" end