anchor.diff:  %% @end
   %%--------------------------------------------------------------------
   -spec get_user(ctx()) -> od_user:doc().
  -get_user(#user_ctx{user_doc = User}) ->
  -    User.
  +get_user(#user_ctx{session = #document{key = SessId, value = #session{
  +    identity = #user_identity{user_id = UserId}
  +}}}) ->
  +    case get(user_ctx_cache) of
  +        undefined ->
  +            {ok, User} = user_logic:get(SessId, UserId),
  +            put(user_ctx_cache, User),
  +            User;
  +        CachedUser ->
  +            CachedUser
  +    end.
   
   %%--------------------------------------------------------------------
   %% @doc
  
positive.code: %%--------------------------------------------------------------------
  -spec new(session:id()) -> ctx() | no_return().
  new(SessId) ->
      {ok, Session = #document{value = #session{
          identity = #user_identity{user_id = UserId}
      }}} = session:get(SessId),
      {ok, User} = user_logic:get(SessId, UserId),
      #user_ctx{
          session = Session,
          user_doc = User
      }.
  
  %%--------------------------------------------------------------------
  
negative.code: 
  %% Context definition
  -record(user_ctx, {
      session :: session:doc()
  }).
  
  -type ctx() :: #user_ctx{}.
  