Harry Potter author wins victory in court