Judge rules Trump adviser can publish book