aleitner commented on code in PR #821:
URL: https://github.com/apache/guacamole-client/pull/821#discussion_r1157429704
##########
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/base/ModeledDirectoryObjectService.java:
##########
@@ -387,25 +396,36 @@ public Collection<InternalType>
retrieveObjects(ModeledAuthenticatedUser user,
Collection<String> identifiers) throws GuacamoleException {
// Ignore invalid identifiers
- identifiers = filterIdentifiers(identifiers);
+ List<String> filteredIdentifiers = filterIdentifiers(identifiers);
// Do not query if no identifiers given
- if (identifiers.isEmpty())
+ if (filteredIdentifiers.isEmpty())
return Collections.<InternalType>emptyList();
- Collection<ModelType> objects;
+ int batchSize = environment.getDefaultBatchSize();
- // Bypass permission checks if the user is privileged
- if (user.isPrivileged())
- objects = getObjectMapper().select(identifiers);
+ Collection<ModelType> allObjects = new
ArrayList<>(filteredIdentifiers.size());
+
+ for (int startIndex = 0; startIndex < filteredIdentifiers.size();
startIndex += batchSize) {
Review Comment:
I switched to a more functional map filter style of code
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]