diff --git a/src/main/java/org/ecocean/EncounterQueryProcessor.java b/src/main/java/org/ecocean/EncounterQueryProcessor.java index bceb5748d4..5b020bd3b2 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); - boolean hasAccess = Encounter.opensearchAccess(h, user, myShepherd); + boolean hasAccess = Encounter.opensearchAccess(h.optJSONObject("_source"), user, + myShepherd); if (hasAccess) encIds.add(hId); } } catch (Exception ex) { @@ -1598,7 +1599,8 @@ public static EncounterQueryResult processQuery(Shepherd myShepherd, HttpServlet return new EncounterQueryResult(rEncounters, searchQuery.toString(), "OpenSearch id " + searchQueryId); } - boolean hasAccess = Encounter.opensearchAccess(h, user, myShepherd); + boolean hasAccess = Encounter.opensearchAccess(h.optJSONObject("_source"), user, + myShepherd); if (hasAccess) { Encounter enc = myShepherd.getEncounter(hId); if (enc != null) rEncounters.add(enc);