Judge OKs prison abuse settlement, rejecting Trump administration’s push to rewrite protections