lib/scrivito/configuration.rb in scrivito_sdk-0.17.0 vs lib/scrivito/configuration.rb in scrivito_sdk-0.18.0

- old
+ new

@@ -176,13 +176,14 @@ def set_defaults! self.ca_file = DEFAULT_CA_FILE self.editing_auth { |env| false } self.endpoint = 'api.scrivito.com' + self.check_batch_size = 100 end - attr_accessor :choose_homepage_callback, :activate_users_and_permissions + attr_accessor :choose_homepage_callback, :check_batch_size # Configure a callback to be invoked when the Scrivito SDK delivers the homepage. # The given callback will receive the rack env # and must return an {BasicObj Obj} to be used as the homepage. # If no callback is configured, {BasicObj.homepage Obj.homepage} will be used as the default. @@ -203,18 +204,19 @@ ' config.action_dispatch.x_sendfile_header = "X-Sendfile"' end def obj_formats @obj_formats ||= { - '_default' => proc do |obj| + '_default' => proc do |obj, user| { id: obj.id, obj_class_name: obj.obj_class_name, description_for_editor: obj.description_for_editor, modification: obj.modification, has_conflict: obj.has_conflict?, last_changed: obj.last_changed.utc.iso8601, is_binary: obj.binary?, + restriction_messages: user.restriction_messages_for(obj) } end } end