anchor.diff:      ok | gui_error:error_result().
   delete_record(<<"data-space">>, _Id) ->
       gui_error:report_error(<<"Not iplemented">>).
  -
  -
  -%%%===================================================================
  -%%% Internal functions
  -%%%===================================================================
  -
  -%%--------------------------------------------------------------------
  -%% @private
  -%% @doc
  -%% Returns a space record based on space id and name.
  -%% @end
  -%%--------------------------------------------------------------------
  --spec space_record(SpaceId :: binary(), SpaceName :: binary()) ->
  -    proplists:proplist().
  -space_record(SpaceId, SpaceName) ->
  -    DefaultSpaceId = g_session:get_value(?DEFAULT_SPACE_KEY),
  -    [
  -        {<<"id">>, SpaceId},
  -        {<<"name">>, SpaceName},
  -        {<<"isDefault">>, SpaceId =:= DefaultSpaceId},
  -        {<<"rootDir">>, SpaceId}
  -    ].
  
positive.code: %%--------------------------------------------------------------------
  -spec find(ResourceType :: binary(), Ids :: [binary()]) ->
      {ok, proplists:proplist()} | gui_error:error_result().
  find(<<"data-space">>, [SpaceId]) ->
      SessionId = g_session:get_session_id(),
      {ok, #file_attr{name = SpaceName}} = logical_file_manager:stat(
          SessionId, {uuid, SpaceId}),
      Res = space_record(SpaceId, SpaceName),
      {ok, Res}.
  
  
  
negative.code:     SessionId = g_session:get_session_id(),
      {ok, #document{value = #session{auth = Auth}}} = session:get(SessionId),
      #auth{macaroon = Mac, disch_macaroons = DMacs} = Auth,
      {ok, DefaultSpaceId} = oz_users:get_default_space({user, {Mac, DMacs}}),
      DefaultSpaceDirId = fslogic_uuid:spaceid_to_space_dir_uuid(DefaultSpaceId),
      g_session:put_value(?DEFAULT_SPACE_KEY, DefaultSpaceDirId),
      ok.
  
  
  