Skip to content
Snippets Groups Projects
Commit 90a7b371 authored by felmer's avatar felmer
Browse files

SSDM-4187: CLI data set uploader works. Bug found and fixed: Authorization...

SSDM-4187: CLI data set uploader works. Bug found and fixed: Authorization failed for project samples in context with non-admin users.

SVN: 37845
parent 7d3247ef
No related branches found
No related tags found
No related merge requests found
......@@ -35,12 +35,12 @@ public class DefaultDropbox extends AbstractJavaDataSetRegistrationDropboxV2
public void process(IDataSetRegistrationTransactionV2 transaction)
{
IDataSet dataSet = transaction.createNewDataSet();
if (dataSet.getExperiment() == null)
if (dataSet.getExperiment() == null && dataSet.getSample() == null)
{
ISampleImmutable sample = transaction.getSearchService().getSample(SAMPLE_IDENTIFIER);
if (sample == null)
{
transaction.createNewSample(SAMPLE_IDENTIFIER, "UNKNOWN");
sample = transaction.createNewSample(SAMPLE_IDENTIFIER, "UNKNOWN");
}
dataSet.setSample(sample);
}
......
......@@ -120,13 +120,12 @@ public class SampleOwnerIdentifier extends AbstractHashable implements Serializa
}
/**
* It is a good pattern to use {@link #isSpaceLevel()} before calling this method.
*
* @return The space which is the owner or null if the owner is not a space, but database instance.
* Returns the space identifier. In case of project samples the project identifier is returned.
* In case of shared sample <code>null</code> is returned.
*/
public SpaceIdentifier getSpaceLevel()
{
return spaceIdentOrNull;
return projectIdentifier != null ? projectIdentifier : spaceIdentOrNull;
}
//
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment