The writ of Quo Warranto is used by courts to challenge the legality of a person's right to hold a public office.