From edc627f0f78d28edc8279db609b99702f5d2a1f9 Mon Sep 17 00:00:00 2001 From: holmbergius Date: Tue, 7 Nov 2023 14:51:23 -0800 Subject: [PATCH] admin cal see all orgs --- src/main/java/org/ecocean/FormUtilities.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/ecocean/FormUtilities.java b/src/main/java/org/ecocean/FormUtilities.java index 12755e7af6..7e9a419591 100644 --- a/src/main/java/org/ecocean/FormUtilities.java +++ b/src/main/java/org/ecocean/FormUtilities.java @@ -144,7 +144,9 @@ public static void setUpProjectIncrementalIdDropdown(Boolean isForIndividualOrOc public static void setUpOrgDropdown(String fieldName, Boolean isForIndividualOrOccurrenceSearch, Properties encprops, JspWriter out, HttpServletRequest request, Shepherd myShepherd){ User usr = AccessControl.getUser(request, myShepherd); if(usr != null){ - List orgsUserBelongsTo = usr.getOrganizations(); + List orgsUserBelongsTo = new ArrayList(); + if(request.isUserInRole("admin")) {orgsUserBelongsTo=myShepherd.getAllOrganizations();} + else {orgsUserBelongsTo = usr.getOrganizations();} ArrayList orgOptions = new ArrayList(); ArrayList orgIds = new ArrayList(); for (int i = 0; i < orgsUserBelongsTo.size(); i++) { //TODO DRY up