lib/scrivito/controller_actions.rb in scrivito_sdk-0.70.0.rc1 vs lib/scrivito/controller_actions.rb in scrivito_sdk-0.70.0.rc2
- old
+ new
@@ -22,11 +22,11 @@
:page_details,
]
before_filter :load_object
- helper_method :scrivito_in_editable_view?
+ hide_action :on_scrivito_widget_error
end
#
# Default action.
# Delivers files directly if +Obj+ is binary.
@@ -97,38 +97,10 @@
# @api public
def on_scrivito_widget_error(widget, error)
raise error
end
- #
- # Returns whether the GUI is in the +editable+ view.
- #
- # +scrivito_in_editable_view?+ is also a helper method.
- #
- # @api public
- # @return +true+ if the current visitor is an authenticated editor, the selected workspace is
- # editable and the display mode is +editing+.
- # @return +false+ otherwise.
- #
- def scrivito_in_editable_view?
- editing_context.editable_display_mode?
- end
-
- #
- # Returns the current user.
- #
- # +scrivito_user+ is also a helper method.
- #
- # @api public
- # @return [Scrivito::User] if the {Scrivito::Configuration.editing_auth} callback returns an
- # instance of {Scrivito::User}.
- # @return +nil+ otherwise.
- #
- def scrivito_user
- editing_context.editor
- end
-
module ClassMethods
#
# This method indicates if this controller should be used automatically when an +Obj+ is
# requested via the SDK's standard routes. It returns +true+ by default.
#
@@ -151,10 +123,12 @@
def editing_context
EditingContextMiddleware.from_request(request)
end
- delegate :comparison, to: :editing_context
+ def comparison
+ editing_context.comparison
+ end
def load_object
CmsEnv.new(request.env).load
loaded_obj = request.env[CmsEnv::OBJ_ENV_KEY]
raise loaded_obj if loaded_obj.is_a?(StandardError)