The high court sided with Attorney General Daniel Cameron.