Skip to content

Commit

Permalink
Merge branch 'master' into sharkbook.ai
Browse files Browse the repository at this point in the history
  • Loading branch information
holmbergius committed Nov 1, 2023
2 parents 4145ea9 + 50eab47 commit bec062c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/org/ecocean/servlet/ServletUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,10 @@ public static boolean isUserAuthorizedForImportTask(ImportTask occ, HttpServletR

//quick collaboration check between current user and bulk import owner
//if(occ.getCreator() !=null && Collaboration.canCollaborate(request.getUserPrincipal().getName(), occ.getCreator().getUsername(), myShepherd.getContext()))return true;
Collaboration collab = Collaboration.collaborationBetweenUsers(myShepherd, request.getUserPrincipal().getName(), occ.getCreator().getUsername());
if(collab!=null && collab.getState()!=null && (collab.getState().equals(Collaboration.STATE_EDIT_PRIV)||collab.getState().equals(Collaboration.STATE_APPROVED)) )return true;

if(request.getUserPrincipal()!=null && request.getUserPrincipal().getName()!=null && occ.getCreator() !=null && occ.getCreator().getUsername()!=null) {
Collaboration collab = Collaboration.collaborationBetweenUsers(myShepherd, request.getUserPrincipal().getName(), occ.getCreator().getUsername());
if(collab!=null && collab.getState()!=null && (collab.getState().equals(Collaboration.STATE_EDIT_PRIV)||collab.getState().equals(Collaboration.STATE_APPROVED)) )return true;
}

//quick orgAdminCheck
//if this user is the orgAdmin for the bulk import's uploading user, they can see it
Expand Down

0 comments on commit bec062c

Please sign in to comment.