@Produces(MEDIATYPE_JSON_JAVASCRIPT)
public Response addUser(@Context HttpServletRequest request,
byte[] userBytes) throws Exception {
RestResponseBuilder response = RestResponseBuilder.forRequest(request);
if (!request.isUserInRole(SecurityService.ADMIN_ROLE)) {
return response.status(Response.Status.FORBIDDEN).build();
}
JsonNode node = readTree(userBytes);
JsonNode userNode = node.get("user");
JsonNode passwordNode = node.get("password");
JsonNode rolesNode = node.get("roles");