anchor.diff:      CanonicalTargetPath :: file_meta:path(),
       LogicalTargetPath :: file_meta:path()) ->
       ok | logical_file_manager:error_reply().
  --check_permissions([{?delete_object, {parent, 2}}, {?add_object, {parent, {path, 3}}}]).
  +-check_permissions([{?delete_object, {parent, 2}}]).
   rename_file(CTX, SourceEntry, CanonicalTargetPath, LogicalTargetPath) ->
       case check_reg_preconditions(CTX, LogicalTargetPath) of
           ok ->
  -            rename_select(CTX, SourceEntry, CanonicalTargetPath, LogicalTargetPath);
  +            rename_select(CTX, SourceEntry, CanonicalTargetPath, LogicalTargetPath, ?REGULAR_FILE_TYPE);
           Error ->
               Error
       end.
  
positive.code: %%--------------------------------------------------------------------
  -spec rename_select(CTX :: fslogic_worker:ctx(), SourceEntry :: fslogic_worker:file(),
      CanonicalTargetPath :: file_meta:path(),
      LogicalTargetPath :: file_meta:path()) ->
      ok | logical_file_manager:error_reply().
  rename_select(CTX, SourceEntry, CanonicalTargetPath, LogicalTargetPath) ->
      {_, TargetParentPath} = fslogic_path:basename_and_parent(CanonicalTargetPath),
      {ok, #document{key = SourceUUID}} = file_meta:get(SourceEntry),
      SourceSpaceId = fslogic_spaces:get_space_id(SourceUUID),
  
negative.code:             CommonProvidersSet = ordsets:intersection(TargetProvidersSet, SourceProvidersSet),
              case ordsets:is_element(oneprovider:get_provider_id(), CommonProvidersSet) of
                  true ->
                      case FileType of
                          ?REGULAR_FILE_TYPE ->
                              rename_file_interspace(CTX, SourceEntry, LogicalTargetPath);
                          ?DIRECTORY_TYPE ->
                              rename_dir_interspace(CTX, SourceEntry, LogicalTargetPath)
                      end;
                  false ->
                      rename_interprovider(CTX, SourceEntry, LogicalTargetPath)
              end
      end.
  
  %%--------------------------------------------------------------------
  %% @doc Checks permissions before renaming regular file within one space.
  %%--------------------------------------------------------------------
  -spec rename_file_trivial(fslogic_worker:ctx(), fslogic_worker:file(),
      file_meta:path()) -> ok | logical_file_manager:error_reply().
  -check_permissions([{traverse_ancestors, {path, 3}}, {?add_object, {parent, {path, 3}}}]).
  rename_file_trivial(CTX, SourceEntry, LogicalTargetPath) ->
      rename_trivial(CTX, SourceEntry, LogicalTargetPath).
  
  %%--------------------------------------------------------------------
  %% @doc Checks permissions before renaming directory within one space.
  %%--------------------------------------------------------------------
  -spec rename_dir_trivial(fslogic_worker:ctx(), fslogic_worker:file(),
      file_meta:path()) -> ok | logical_file_manager:error_reply().
  -check_permissions([{traverse_ancestors, {path, 3}}, {?add_subcontainer, {parent, {path, 3}}}]).
  rename_dir_trivial(CTX, SourceEntry, LogicalTargetPath) ->
      rename_trivial(CTX, SourceEntry, LogicalTargetPath).
  
  %%--------------------------------------------------------------------
  %% @doc Renames file within one space.
  %%--------------------------------------------------------------------
  -spec rename_trivial(fslogic_worker:ctx(), fslogic_worker:file(),
      file_meta:path()) -> ok | logical_file_manager:error_reply().
  rename_trivial(CTX, SourceEntry, LogicalTargetPath) ->
      rename_interspace(CTX, SourceEntry, LogicalTargetPath).
  
  
  %%--------------------------------------------------------------------
  %% @doc Checks permissions before renaming regular file within one provider.
  %%--------------------------------------------------------------------
  -spec rename_file_interspace(fslogic_worker:ctx(), fslogic_worker:file(),
      file_meta:path()) -> ok | logical_file_manager:error_reply().
  -check_permissions([{traverse_ancestors, {path, 3}}, {?add_object, {parent, {path, 3}}}]).
  rename_file_interspace(CTX, SourceEntry, LogicalTargetPath) ->
      rename_interspace(CTX, SourceEntry, LogicalTargetPath).
  
  %%--------------------------------------------------------------------
  %% @doc Checks permissions before renaming directory within one provider.
  %%--------------------------------------------------------------------
  -spec rename_dir_interspace(fslogic_worker:ctx(), fslogic_worker:file(),
      file_meta:path()) -> ok | logical_file_manager:error_reply().
  -check_permissions([{traverse_ancestors, {path, 3}}, {?add_subcontainer, {parent, {path, 3}}}]).
  rename_dir_interspace(CTX, SourceEntry, LogicalTargetPath) ->
      rename_interspace(CTX, SourceEntry, LogicalTargetPath).
  
  %%--------------------------------------------------------------------
  