diff --git a/src/main/java/org/ecocean/EncounterQueryProcessor.java b/src/main/java/org/ecocean/EncounterQueryProcessor.java index 04d3ba505e..bceb5748d4 100644 --- a/src/main/java/org/ecocean/EncounterQueryProcessor.java +++ b/src/main/java/org/ecocean/EncounterQueryProcessor.java @@ -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(); @@ -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();