app/controllers/scrivito/webservice_controller.rb in scrivito_sdk-1.15.0 vs app/controllers/scrivito/webservice_controller.rb in scrivito_sdk-1.16.0.rc1
- old
+ new
@@ -8,11 +8,10 @@
@timestamp = Time.zone.now
render 'scrivito/webservice/error', formats: :json, status: error.http_code
end
before_action :verify_authenticity_token_for_every_request
- before_action :merge_correctly_parsed_json_params if Scrivito::LegacySwitch.rails4?
before_action :authorize
private
# similar to Rails' verify_authenticity_token, but also protects GET and HEAD
@@ -40,21 +39,9 @@
# If +true+, allow access to ObjsController, else deny access.
# See {Scrivito::Configuration.editing_auth} for details.
# @return [Boolean]
def allow_access?
scrivito_user.present?
- end
-
- # Workaround for https://github.com/rails/rails/issues/8832
- def merge_correctly_parsed_json_params
- if request.format.json?
- body = request.body.read
- request.body.rewind
- params.merge!(ActiveSupport::JSON.decode(body)) if body.present?
- end
- rescue JSON::ParserError => e
- # Rails TestRequest mixes up arguments, therefore ignore elements here
- raise e unless Rails.env.test?
end
def can_user_access_workspace?(verb, workspace)
scrivito_user.can?(verb, workspace)
end