diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/sample/CreateSampleExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/sample/CreateSampleExecutor.java index fa232152530c77d8914734f617ecb6d6b6c673d1..26b76ec7635ca1fa6582b78cd8ba1e8e6f02aeda 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/sample/CreateSampleExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/sample/CreateSampleExecutor.java @@ -91,6 +91,10 @@ public class CreateSampleExecutor extends AbstractCreateEntityExecutor<SampleCre for (SampleCreation creation : creations) { + if (creation.getProjectId() != null) + { + throw new UserFailureException("Currently it isn't possible to create a sample for project " + creation.getProjectId()); + } SamplePE sample = new SamplePE(); sample.setCode(creation.getCode()); String createdPermId = daoFactory.getPermIdDAO().createPermId(); diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/sample/UpdateSampleExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/sample/UpdateSampleExecutor.java index a7b17f10ed6e53560a8f64d72492316d0ca6a7c8..a1026e86b4a6cb7afcffcdd03e50d8a839801e5c 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/sample/UpdateSampleExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/api/v3/executor/sample/UpdateSampleExecutor.java @@ -87,6 +87,10 @@ public class UpdateSampleExecutor extends AbstractUpdateEntityExecutor<SampleUpd { throw new UserFailureException("Sample id cannot be null."); } + if (update.getProjectId() != null) + { + throw new UserFailureException("Currently the project can not be set for sample " + update.getSampleId()); + } } @Override