Accepting a baseline from a private workspace
The API for accepting baselines into a workspace:
com.ibm.team.scm.client.IWorkspaceConnection.accept(int, IWorkspaceConnection, IChangeHistorySyncReport, List, List, IProgressMonitor)
requires to have a "source" workspace connection, which you can't do if you don't have access to such workspace (for example, when is set to "private").
Although I can understand why it is required, it seems contradictory, since baselines are "public" (you can see them always in the component's baselines, even if the workspace are private). You can even add/replace your own workspace component from that baseline.
Is there another way I can do this operation, without having access to the source workspace?
One answer
The concept of "accept" means you are 'accepting it from somewhere', so unfortunately the source is needed in this API.
One benefit of accepting baselines from a source is shown in the Baseline History Graph, which helps track where baselines came from, and how they flow through the system (across workspaces /streams). As a reference to this feature, see:
The other option is to perform a component replace. See:
IFlowNodeConnection.replaceComponent(IComponentHandle comp, IConnection seed, IWorkspaceHandle operationSource, boolean produceDetailedUpdates);
Note: This API also gives an opportunity to provide a operationSource, so I recommend using that when possible as well.