A court in Edinburgh has ruled that the former UK government’s go-ahead for the Rosebank oilfield off Shetland was unlawful.