The university sought the court order due to previous protest disruptions, particularly by the group Cambridge for Palestine.
The judge granted a limited, interim injunction specifically blocking protests in the Senate House and Yard during a graduation ceremony on Saturday.
The judge criticised the university's application, saying it had given insufficient notice to potential stakeholders and had not painted a complete picture of past graduations.
This decision is considered a victory for freedom of assembly and protest on university campuses.