/**
  * Retrieve group memberships for given user.
  *
  * @param headers
  * @param username
  * @return
  * @throws IOException
  * @throws JargonException
  */
 @RequestMapping(value = "/services/users/{username}/usergroups", method = RequestMethod.GET)
 @ResponseBody
 public UserGroupListMetadata getUserMemberships(@PathVariable("username") String username)
     throws JargonException, IOException {
   IRODSAccount irodsAccount =
       (IRODSAccount) request.getSession().getAttribute("SPRING_SECURITY_CONTEXT");
   UserGroupAO userGroupAO = irodsAccessObjectFactory.getUserGroupAO(irodsAccount);
   UserGroupListMetadata groups =
       new UserGroupListMetadata(userGroupAO.findUserGroupsForUser(username));
   return groups;
 }