diff --git a/web/src/main/java/org/mskcc/cbio/portal/web/ProxySessionServiceController.java b/web/src/main/java/org/mskcc/cbio/portal/web/ProxySessionServiceController.java index 5873d0cfcb6..7ef96455c33 100644 --- a/web/src/main/java/org/mskcc/cbio/portal/web/ProxySessionServiceController.java +++ b/web/src/main/java/org/mskcc/cbio/portal/web/ProxySessionServiceController.java @@ -151,7 +151,7 @@ public void addUsertoVirtualStudy(@PathVariable String id, Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (!StringUtils.isEmpty(sessionServiceURL) && authentication != null && !(authentication instanceof AnonymousAuthenticationToken)) { - updateVirutalStudyUser(id, + updateVirtualStudyUser(id, ((UserDetails)authentication.getPrincipal()).getUsername(), Operation.add, response); @@ -168,7 +168,7 @@ public void removeUserFromVirtualStudy(@PathVariable String id, Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (!StringUtils.isEmpty(sessionServiceURL) && authentication != null && !(authentication instanceof AnonymousAuthenticationToken)) { - updateVirutalStudyUser(id, + updateVirtualStudyUser(id, ((UserDetails)authentication.getPrincipal()).getUsername(), Operation.delete, response); @@ -214,7 +214,7 @@ private Map addSession(SessionType type, } - private void updateVirutalStudyUser(String id, + private void updateVirtualStudyUser(String id, String user, Operation operation, HttpServletResponse response) throws IOException { @@ -240,7 +240,7 @@ private void updateVirutalStudyUser(String id, RestTemplate restTemplate = new RestTemplate(); HttpEntity httpEntity = new HttpEntity(virtualStudy.getData(), getHttpHeaders()); - restTemplate.exchange(sessionServiceURL + SessionType.virtual_study + "/" + id, HttpMethod.POST, httpEntity, HashMap.class); + restTemplate.exchange(sessionServiceURL + SessionType.virtual_study + "/" + id, HttpMethod.PUT, httpEntity, HashMap.class); } catch (Exception e) { e.printStackTrace();