Updated write exclusion behavior

This commit is contained in:
Giancarlo Panichi 2022-03-25 12:47:26 +01:00
parent 6d74cf7fc3
commit 81c260646d
1 changed files with 21 additions and 12 deletions

View File

@ -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,16 +537,26 @@ public class AbstractEcologicalEngineMapper extends AbstractAnnotatedAlgorithm i
}
private boolean checkWriteAuthorization(String username) {
if (env != null && env.getShubUsersExcluded() != null) {
if (env != null) {
if (env.getShubUsersExcluded() != null) {
if (env.getShubUsersExcluded().isEmpty()) {
return false;
// 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;
}
}
private void accountAlgorithmExecution(long start, long end, OperationResult result) {
try {