anchor.diff:          undefined -> null;
           _ -> DefaultProviderValue
       end,
  -    {ok, [{effective_groups, Groups}]} = user_logic:get_effective_groups(UserId),
  -    {ok, UserSpaces} = user_logic:get_spaces(UserId),
  -    Spaces = proplists:get_value(spaces, UserSpaces),
  -    {ok, [{providers, Providers}]} = user_logic:get_providers(UserId),
       [
           {<<"id">>, UserId},
           {<<"name">>, Name},
  
positive.code: %%--------------------------------------------------------------------
  %% @private
  %% @doc
  %% Returns a client-compliant user record based on space id.
  %% @end
  %%--------------------------------------------------------------------
  -spec user_record(UserId :: od_user:id()) -> proplists:proplist().
  user_record(UserId) ->
      {ok, #document{value = #od_user{
          name = Name,
          alias = UserAlias,
          basic_auth_enabled = BasicAuthEnabled,
          connected_accounts = OAuthAccounts,
          client_tokens = ClientTokenIds,
          default_space = DefaultSpaceValue,
          default_provider = DefaultProviderValue
      }}} = od_user:get(UserId),
      Alias = case str_utils:to_binary(UserAlias) of
          <<"">> -> null;
          Bin -> Bin
  
negative.code: -export([init/0, terminate/0]).
  -export([find_record/2, find_all/1, query/2]).
  -export([create_record/2, update_record/3, delete_record/2]).
  -export([user_record/2]).
  
  %%%===================================================================
  %%% data_backend_behaviour callbacks
  