From 1a30ee8e4771a58c269bc4c66ab4d93c52b2f638 Mon Sep 17 00:00:00 2001 From: juanf <juanf> Date: Mon, 6 Feb 2017 10:52:25 +0000 Subject: [PATCH] SSDM-4686 : v3 roles bug - deleting unused code SVN: 37688 --- .../ExperimentAuthorizationExecutor.java | 15 --------------- .../material/MaterialAuthorizationExecutor.java | 3 --- .../project/ProjectAuthorizationExecutor.java | 15 --------------- .../sample/SampleAuthorizationExecutor.java | 15 --------------- 4 files changed, 48 deletions(-) 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 19babadbec7..f1876d07f4d 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 6a5b2f60825..ee888a55708 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 6ed66646169..aabf2cce3ba 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 1ce2104c070..c21e0de78fb 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 -- GitLab