diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e560318bb4372e3882b21c0acb12f2bdd443643..d9edd2462443f6a723c9d1ab4d38756ee1327eb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +* #130 - Error during `FIND ENTITY` when + `QUERY_FILTER_ENTITIES_WITHOUT_RETRIEVE_PERMISSIONS=False`. * #125 - `bend_symlinks` script did not allow whitespace in filename. * #122 - Dead-lock due to error in the DatabaseAccessManager. * #120 - Editing entities that were created with a no longer existing user diff --git a/Makefile b/Makefile index d73f140f065ca0b3db62651e40162194f4ffb4eb..21fe03d07ff5e08a7831e4453a69a0155fe7e4d8 100644 --- a/Makefile +++ b/Makefile @@ -64,7 +64,7 @@ antlr: mvn antlr4:antlr4 test: print-version easy-units - MAVEN_DEBUG_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Dcaosdb.debug=true -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=0.0.0.0:9000" + MAVEN_DEBUG_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Dcaosdb.debug=true -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=0.0.0.0:$(JPDA_PORT)" mvn test -X test_misc: diff --git a/src/main/java/org/caosdb/server/query/Query.java b/src/main/java/org/caosdb/server/query/Query.java index cd323bd972b21a261c84bfa6c16c08ea54558fd0..058fc619e021b96e1ac3d83750d7ed84c5acc2c0 100644 --- a/src/main/java/org/caosdb/server/query/Query.java +++ b/src/main/java/org/caosdb/server/query/Query.java @@ -206,7 +206,7 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac } } - private static boolean filterEntitiesWithoutRetrievePermisions = + private boolean filterEntitiesWithoutRetrievePermisions = !CaosDBServer.getServerProperty( ServerProperties.KEY_QUERY_FILTER_ENTITIES_WITHOUT_RETRIEVE_PERMISSIONS) .equalsIgnoreCase("FALSE"); @@ -663,13 +663,15 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac if (this.container != null && this.type == Type.FIND) { for (final IdVersionPair p : this.resultSet) { - final Entity e = new RetrieveEntity(p.id, p.version); + if (p.id > 99) { + final Entity e = new RetrieveEntity(p.id, p.version); - // if query has select-clause: - if (this.selections != null && !this.selections.isEmpty()) { - e.addSelections(this.selections); + // if query has select-clause: + if (this.selections != null && !this.selections.isEmpty()) { + e.addSelections(this.selections); + } + this.container.add(e); } - this.container.add(e); } } return this;