Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: dont skip admins in our creation of collab structure #956

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/main/java/org/ecocean/Encounter.java
Original file line number Diff line number Diff line change
Expand Up @@ -3933,13 +3933,10 @@ public static void opensearchIndexPermissions() {
Shepherd myShepherd = new Shepherd("context0");
myShepherd.setAction("Encounter.opensearchIndexPermissions");
myShepherd.beginDBTransaction();
int nonAdminCt = 0;
// it seems as though user.uuid is *required* so we can trust that
try {
for (User user : myShepherd.getUsersWithUsername()) {
usernameToId.put(user.getUsername(), user.getId());
if (user.isAdmin(myShepherd)) continue;
nonAdminCt++;
List<Collaboration> collabsFor = Collaboration.collaborationsForUser(myShepherd,
user.getUsername());
if (Util.collectionIsEmptyOrNull(collabsFor)) continue;
Expand All @@ -3955,7 +3952,7 @@ public static void opensearchIndexPermissions() {
}
Util.mark("perm: user build done", startT);
System.out.println("opensearchIndexPermissions(): " + usernameToId.size() +
" total users; " + nonAdminCt + " non-admin; " + collab.size() + " have active collab");
" total users; " + collab.size() + " have active collab");
// now iterated over (non-public) encounters
int encCount = 0;
org.json.JSONObject updateData = new org.json.JSONObject();
Expand Down
Loading