class ViewModel::TraversalContext::SharedContext

def initialize(access_control: ViewModel::AccessControl::Open.new, callbacks: [])

def initialize(access_control: ViewModel::AccessControl::Open.new, callbacks: [])
  @access_control = access_control
  # Access control is guaranteed to be run after callbacks that may have
  # side-effects on the view.
  pre_callbacks, post_callbacks = callbacks.partition { |c| c.class.updates_view? }
  @callbacks = pre_callbacks + [access_control] + post_callbacks
end