Skip to content

Commit

Permalink
skip encounters with no access (unsanitized query now)
Browse files Browse the repository at this point in the history
  • Loading branch information
naknomum committed Dec 20, 2024
1 parent 792d5d6 commit 089329c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/java/org/ecocean/EncounterQueryProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ public static String queryStringBuilder(HttpServletRequest request, StringBuffer
return failed;
}
// Encounter enc = myShepherd.getEncounter(hId);
encIds.add(hId);
boolean hasAccess = Encounter.opensearchAccess(h, user, myShepherd);
if (hasAccess) encIds.add(hId);
}
} catch (Exception ex) {
ex.printStackTrace();
Expand Down Expand Up @@ -1597,8 +1598,11 @@ public static EncounterQueryResult processQuery(Shepherd myShepherd, HttpServlet
return new EncounterQueryResult(rEncounters, searchQuery.toString(),
"OpenSearch id " + searchQueryId);
}
Encounter enc = myShepherd.getEncounter(hId);
if (enc != null) rEncounters.add(enc);
boolean hasAccess = Encounter.opensearchAccess(h, user, myShepherd);
if (hasAccess) {
Encounter enc = myShepherd.getEncounter(hId);
if (enc != null) rEncounters.add(enc);
}
}
} catch (Exception ex) {
ex.printStackTrace();
Expand Down

0 comments on commit 089329c

Please sign in to comment.