class ChangesetsController < ApiController
require "xml/libxml"
+ before_action :check_api_writable, :only => [:create, :update, :upload, :subscribe, :unsubscribe]
+ before_action :check_api_readable, :except => [:create, :update, :upload, :download, :query, :subscribe, :unsubscribe]
before_action :authorize, :only => [:create, :update, :upload, :close, :subscribe, :unsubscribe]
authorize_resource
before_action :require_public_data, :only => [:create, :update, :upload, :close, :subscribe, :unsubscribe]
- before_action :check_api_writable, :only => [:create, :update, :upload, :subscribe, :unsubscribe]
- before_action :check_api_readable, :except => [:create, :update, :upload, :download, :query, :subscribe, :unsubscribe]
before_action :set_request_formats, :except => [:create, :close, :upload]
around_action :api_call_handle_error
# Helper methods for checking consistency
include ConsistencyValidations
+ ##
+ # Return XML giving the basic info about the changeset. Does not
+ # return anything about the nodes, ways and relations in the changeset.
+ def show
+ @changeset = Changeset.find(params[:id])
+ @include_discussion = params[:include_discussion].presence
+ render "changeset"
+
+ respond_to do |format|
+ format.xml
+ format.json
+ end
+ end
+
# Create a changeset from XML.
def create
assert_method :put
render :plain => cs.id.to_s
end
- ##
- # Return XML giving the basic info about the changeset. Does not
- # return anything about the nodes, ways and relations in the changeset.
- def show
- @changeset = Changeset.find(params[:id])
- @include_discussion = params[:include_discussion].presence
- render "changeset"
-
- respond_to do |format|
- format.xml
- format.json
- end
- end
-
##
# marks a changeset as closed. this may be called multiple times
# on the same changeset, so is idempotent.