diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/experiment/ExperimentAuthorizationExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/experiment/ExperimentAuthorizationExecutor.java index 19babadbec74a779d0cc30166bcea5b14e75663c..f1876d07f4d9e685bc5557029fd7ccdca106db9c 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/experiment/ExperimentAuthorizationExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/experiment/ExperimentAuthorizationExecutor.java @@ -18,15 +18,12 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.executor.experiment; import org.springframework.stereotype.Component; -import ch.ethz.sis.openbis.generic.asapi.v3.dto.experiment.id.ExperimentIdentifier; import ch.ethz.sis.openbis.generic.asapi.v3.dto.experiment.id.IExperimentId; -import ch.ethz.sis.openbis.generic.asapi.v3.exceptions.UnauthorizedObjectAccessException; import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.IOperationContext; import ch.systemsx.cisd.openbis.generic.server.authorization.annotation.AuthorizationGuard; import ch.systemsx.cisd.openbis.generic.server.authorization.annotation.Capability; import ch.systemsx.cisd.openbis.generic.server.authorization.annotation.RolesAllowed; import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.ExperimentPEPredicate; -import ch.systemsx.cisd.openbis.generic.server.authorization.validator.ExperimentByIdentiferValidator; import ch.systemsx.cisd.openbis.generic.shared.DatabaseCreateOrDeleteModification; import ch.systemsx.cisd.openbis.generic.shared.DatabaseUpdateModification; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; @@ -46,10 +43,6 @@ public class ExperimentAuthorizationExecutor implements IExperimentAuthorization @DatabaseCreateOrDeleteModification(value = ObjectKind.EXPERIMENT) public void canCreate(IOperationContext context, @AuthorizationGuard(guardClass = ExperimentPEPredicate.class) ExperimentPE experiment) { - if (false == new ExperimentByIdentiferValidator().doValidation(context.getSession().tryGetPerson(), experiment)) - { - throw new UnauthorizedObjectAccessException(new ExperimentIdentifier(experiment.getIdentifier())); - } } @Override @@ -59,10 +52,6 @@ public class ExperimentAuthorizationExecutor implements IExperimentAuthorization public void canUpdate(IOperationContext context, IExperimentId id, @AuthorizationGuard(guardClass = ExperimentPEPredicate.class) ExperimentPE experiment) { - if (false == new ExperimentByIdentiferValidator().doValidation(context.getSession().tryGetPerson(), experiment)) - { - throw new UnauthorizedObjectAccessException(id); - } } @Override @@ -72,10 +61,6 @@ public class ExperimentAuthorizationExecutor implements IExperimentAuthorization public void canDelete(IOperationContext context, IExperimentId id, @AuthorizationGuard(guardClass = ExperimentPEPredicate.class) ExperimentPE experiment) { - if (false == new ExperimentByIdentiferValidator().doValidation(context.getSession().tryGetPerson(), experiment)) - { - throw new UnauthorizedObjectAccessException(id); - } } @Override diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/MaterialAuthorizationExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/MaterialAuthorizationExecutor.java index 6a5b2f60825ce0f31f1e6371e717d72f47ff032e..ee888a557086715251a56112ede74cce4d2fca2a 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/MaterialAuthorizationExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/material/MaterialAuthorizationExecutor.java @@ -41,7 +41,6 @@ public class MaterialAuthorizationExecutor implements IMaterialAuthorizationExec @DatabaseCreateOrDeleteModification(value = ObjectKind.MATERIAL) public void canCreate(IOperationContext context, MaterialPE material) { - // nothing to do } @Override @@ -50,7 +49,6 @@ public class MaterialAuthorizationExecutor implements IMaterialAuthorizationExec @DatabaseUpdateModification(value = ObjectKind.MATERIAL) public void canUpdate(IOperationContext context, IMaterialId id, MaterialPE material) { - // nothing to do } @Override @@ -59,7 +57,6 @@ public class MaterialAuthorizationExecutor implements IMaterialAuthorizationExec @Capability("DELETE_MATERIAL") public void canDelete(IOperationContext context, IMaterialId id, MaterialPE material) { - // nothing to do } @Override diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/ProjectAuthorizationExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/ProjectAuthorizationExecutor.java index 6ed6664616990543e1efe698d0de3c0c27180c60..aabf2cce3babf5186f913a3001db3cba7f078d3a 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/ProjectAuthorizationExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/project/ProjectAuthorizationExecutor.java @@ -19,14 +19,11 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.executor.project; import org.springframework.stereotype.Component; import ch.ethz.sis.openbis.generic.asapi.v3.dto.project.id.IProjectId; -import ch.ethz.sis.openbis.generic.asapi.v3.dto.project.id.ProjectIdentifier; -import ch.ethz.sis.openbis.generic.asapi.v3.exceptions.UnauthorizedObjectAccessException; import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.IOperationContext; import ch.systemsx.cisd.openbis.generic.server.authorization.annotation.AuthorizationGuard; import ch.systemsx.cisd.openbis.generic.server.authorization.annotation.Capability; import ch.systemsx.cisd.openbis.generic.server.authorization.annotation.RolesAllowed; import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.ProjectPEPredicate; -import ch.systemsx.cisd.openbis.generic.server.authorization.validator.ProjectByIdentiferValidator; import ch.systemsx.cisd.openbis.generic.shared.DatabaseCreateOrDeleteModification; import ch.systemsx.cisd.openbis.generic.shared.DatabaseUpdateModification; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; @@ -46,10 +43,6 @@ public class ProjectAuthorizationExecutor implements IProjectAuthorizationExecut @DatabaseCreateOrDeleteModification(value = ObjectKind.PROJECT) public void canCreate(IOperationContext context, @AuthorizationGuard(guardClass = ProjectPEPredicate.class) ProjectPE project) { - if (false == new ProjectByIdentiferValidator().doValidation(context.getSession().tryGetPerson(), project)) - { - throw new UnauthorizedObjectAccessException(new ProjectIdentifier(project.getIdentifier())); - } } @Override @@ -58,10 +51,6 @@ public class ProjectAuthorizationExecutor implements IProjectAuthorizationExecut @DatabaseUpdateModification(value = ObjectKind.PROJECT) public void canUpdate(IOperationContext context, IProjectId id, @AuthorizationGuard(guardClass = ProjectPEPredicate.class) ProjectPE project) { - if (false == new ProjectByIdentiferValidator().doValidation(context.getSession().tryGetPerson(), project)) - { - throw new UnauthorizedObjectAccessException(id); - } } @Override @@ -70,10 +59,6 @@ public class ProjectAuthorizationExecutor implements IProjectAuthorizationExecut @Capability("DELETE_PROJECT") public void canDelete(IOperationContext context, IProjectId id, @AuthorizationGuard(guardClass = ProjectPEPredicate.class) ProjectPE project) { - if (false == new ProjectByIdentiferValidator().doValidation(context.getSession().tryGetPerson(), project)) - { - throw new UnauthorizedObjectAccessException(id); - } } @Override diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/SampleAuthorizationExecutor.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/SampleAuthorizationExecutor.java index 1ce2104c0700511973c900c861e1a6b0117d4085..c21e0de78fb4d12320a41f3bac684fc235839cf2 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/SampleAuthorizationExecutor.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/executor/sample/SampleAuthorizationExecutor.java @@ -19,14 +19,11 @@ package ch.ethz.sis.openbis.generic.server.asapi.v3.executor.sample; import org.springframework.stereotype.Component; import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.id.ISampleId; -import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.id.SampleIdentifier; -import ch.ethz.sis.openbis.generic.asapi.v3.exceptions.UnauthorizedObjectAccessException; import ch.ethz.sis.openbis.generic.server.asapi.v3.executor.IOperationContext; import ch.systemsx.cisd.openbis.generic.server.authorization.annotation.AuthorizationGuard; import ch.systemsx.cisd.openbis.generic.server.authorization.annotation.Capability; import ch.systemsx.cisd.openbis.generic.server.authorization.annotation.RolesAllowed; import ch.systemsx.cisd.openbis.generic.server.authorization.predicate.SamplePEPredicate; -import ch.systemsx.cisd.openbis.generic.server.authorization.validator.SampleByIdentiferValidator; import ch.systemsx.cisd.openbis.generic.shared.DatabaseCreateOrDeleteModification; import ch.systemsx.cisd.openbis.generic.shared.DatabaseUpdateModification; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseModificationKind.ObjectKind; @@ -46,10 +43,6 @@ public class SampleAuthorizationExecutor implements ISampleAuthorizationExecutor @DatabaseCreateOrDeleteModification(value = ObjectKind.SAMPLE) public void canCreate(IOperationContext context, @AuthorizationGuard(guardClass = SamplePEPredicate.class) SamplePE sample) { - if (false == new SampleByIdentiferValidator().doValidation(context.getSession().tryGetPerson(), sample)) - { - throw new UnauthorizedObjectAccessException(new SampleIdentifier(sample.getIdentifier())); - } } @Override @@ -59,10 +52,6 @@ public class SampleAuthorizationExecutor implements ISampleAuthorizationExecutor public void canUpdate(IOperationContext context, ISampleId id, @AuthorizationGuard(guardClass = SamplePEPredicate.class) SamplePE sample) { - if (false == new SampleByIdentiferValidator().doValidation(context.getSession().tryGetPerson(), sample)) - { - throw new UnauthorizedObjectAccessException(id); - } } @Override @@ -72,10 +61,6 @@ public class SampleAuthorizationExecutor implements ISampleAuthorizationExecutor public void canDelete(IOperationContext context, ISampleId id, @AuthorizationGuard(guardClass = SamplePEPredicate.class) SamplePE sample) { - if (false == new SampleByIdentiferValidator().doValidation(context.getSession().tryGetPerson(), sample)) - { - throw new UnauthorizedObjectAccessException(id); - } } @Override