From 81c260646dfe66b21804fc06c387c1fc44e45216 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Fri, 25 Mar 2022 12:47:26 +0100 Subject: [PATCH] Updated write exclusion behavior --- .../AbstractEcologicalEngineMapper.java | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/gcube/dataanalysis/wps/statisticalmanager/synchserver/mapping/AbstractEcologicalEngineMapper.java b/src/main/java/org/gcube/dataanalysis/wps/statisticalmanager/synchserver/mapping/AbstractEcologicalEngineMapper.java index f8b08ac..a8e27d1 100755 --- a/src/main/java/org/gcube/dataanalysis/wps/statisticalmanager/synchserver/mapping/AbstractEcologicalEngineMapper.java +++ b/src/main/java/org/gcube/dataanalysis/wps/statisticalmanager/synchserver/mapping/AbstractEcologicalEngineMapper.java @@ -53,12 +53,11 @@ public class AbstractEcologicalEngineMapper extends AbstractAnnotatedAlgorithm i private static final int COMPUTATION_WAIT_FOR_RUN_REQUEST = 20000; /** - * Deploying procedure: 1 - modify configuration files 2 - modify resource - * file: resources/templates/setup.cfg 3 - generate classes with - * ClassGenerator 4 - add new classes in the wps_config.xml on the wps web - * app config folder 5 - produce the Jar file of this project 6 - copy the - * jar file in the lib folder of the wps web app change the server - * parameters in the wps_config.xml file + * Deploying procedure: 1 - modify configuration files 2 - modify resource file: + * resources/templates/setup.cfg 3 - generate classes with ClassGenerator 4 - + * add new classes in the wps_config.xml on the wps web app config folder 5 - + * produce the Jar file of this project 6 - copy the jar file in the lib folder + * of the wps web app change the server parameters in the wps_config.xml file */ private static final Logger LOGGER = LoggerFactory.getLogger(AbstractEcologicalEngineMapper.class); @@ -538,15 +537,25 @@ public class AbstractEcologicalEngineMapper extends AbstractAnnotatedAlgorithm i } private boolean checkWriteAuthorization(String username) { - if (env != null && env.getShubUsersExcluded() != null) { - if (env.getShubUsersExcluded().isEmpty()) { - return false; - } - if (env.getShubUsersExcluded().contains(username)) { + if (env != null) { + if (env.getShubUsersExcluded() != null) { + if (env.getShubUsersExcluded().isEmpty()) { + // all users write + return true; + } + if (env.getShubUsersExcluded().contains(username)) { + return false; + } else { + // username write + return true; + } + } else { + //This is the * case, no users write. return false; } + } else { + return false; } - return true; } private void accountAlgorithmExecution(long start, long end, OperationResult result) {