Skip to content

Commit

Permalink
Resolved issue with ManagementController.java
Browse files Browse the repository at this point in the history
  • Loading branch information
sabre1041 committed Jan 15, 2021
1 parent d0dcd32 commit 7236661
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/main/java/com/redhat/sso/ninja/ManagementController.java
Original file line number Diff line number Diff line change
Expand Up @@ -309,24 +309,6 @@ public Response databaseSave(@Context HttpServletRequest request,@Context HttpSe
return Response.status(200).entity(Json.newObjectMapper(true).writeValueAsString(Database2.get())).build();
}

// Admin UI to be able to update a single user field
@PUT
@Path("/users/{user}")
public Response updateUserProperty(@Context HttpServletRequest request, @PathParam("user") String user) throws JsonGenerationException, JsonMappingException, IOException{

Map<String,String> values=Json.newObjectMapper(true).readValue(IOUtils2.toStringAndClose(request.getInputStream()), new TypeReference<Map<String,String>>() {});
Database2 db=Database2.get();
Map<String, String> userInfo=db.getUsers().get(user);
for (Entry<String, String> e:values.entrySet()){
String existingValue=userInfo.get(e.getKey());
// System.out.println((existingValue!=null?"changing existing ":"adding new ")+"value "+e.getKey()+"->"+e.getValue());
userInfo.put(e.getKey(), e.getValue());
}
db.save();

return Response.status(200).build();
}

// Admin UI to be able to update a single user field

@PUT
Expand Down

0 comments on commit 7236661

Please sign in to comment.