This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git commit f6dc194ee6a31364d37d297bbcd9ad5470d4bf4b Author: Tony CHEMIT <chemit@codelutin.com> Date: Thu Sep 1 10:14:48 2016 +0200 Bien gérer les droits avant une syncrho de référentiel avancé --- .../application/swing/ui/admin/AdminUIModel.java | 34 ++++++++++++++++------ services-api/pom.xml | 2 +- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/admin/AdminUIModel.java b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/admin/AdminUIModel.java index 0b620fb..175770a 100644 --- a/application-swing/src/main/java/fr/ird/observe/application/swing/ui/admin/AdminUIModel.java +++ b/application-swing/src/main/java/fr/ird/observe/application/swing/ui/admin/AdminUIModel.java @@ -1147,6 +1147,9 @@ public class AdminUIModel extends WizardExtModel<AdminStep> { validate = validateNotSameDataSources(); ObserveDataSourceInformation leftDataSourceInformation = getLocalSourceInformation(); + if (leftDataSourceInformation == null) { + return false; + } if (!(leftDataSourceInformation.canReadReferential())) { if (log.isDebugEnabled()) { log.debug("can not read and write referential on left data source"); @@ -1154,22 +1157,35 @@ public class AdminUIModel extends WizardExtModel<AdminStep> { return false; } - if (centralSourceModel.getDataSourceInformation() != null) { + ObserveDataSourceInformation rightDataSourceInformation = centralSourceModel.getDataSourceInformation(); + if (rightDataSourceInformation == null) { + return false; + } - ObserveDataSourceInformation rightDataSourceInformation = centralSourceModel.getDataSourceInformation(); - if (!(rightDataSourceInformation.canReadReferential())) { - if (log.isDebugEnabled()) { - log.debug("can not read and write referential on right data source"); - } - return false; + if (!(rightDataSourceInformation.canReadReferential())) { + if (log.isDebugEnabled()) { + log.debug("can not read and write referential on right data source"); } - + return false; } - if (getReferentialSynchroModel().getSynchronizeMode() == null) { + ReferentialSynchronizeMode synchronizeMode = getReferentialSynchroModel().getSynchronizeMode(); + if (synchronizeMode == null) { return false; } + if (synchronizeMode.isLeftWrite()) { + + validate = localSourceModel.isLocal() || leftDataSourceInformation.canWriteReferential(); + + } + + if (synchronizeMode.isRightWrite()) { + + validate = centralSourceModel.isLocal() || rightDataSourceInformation.canWriteReferential(); + + } + } if (containsOperation(AdminStep.SYNCHRONIZE)) { diff --git a/services-api/pom.xml b/services-api/pom.xml index b81770a..5ee09b9 100644 --- a/services-api/pom.xml +++ b/services-api/pom.xml @@ -42,7 +42,7 @@ <groupId>org.nuiton</groupId> <artifactId>nuiton-validator</artifactId> </dependency> - + <!-- commons dependencies --> <dependency> <groupId>commons-logging</groupId> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.