@DELETE
@Path("{id}")
@Transactional
public Response deleteProject(@PathParam("id") long userId) throws CloudException {
UserData user = getUser(userId);
if (user.getId() == getAuth().getUser().getId()) {
// Don't let people delete themselves
// TODO: Only protect admin account??
throw new IllegalArgumentException();
}
// TODO: Mark as deleted?
// TODO: Deleted related things e.g. credentials?
// TODO: Block delete if "in use"
authRepository.getProjects().delete(user.getId());
ResponseBuilder response = Response.noContent();
return response.build();
}