
414 P.2d 949 (1966)
82 Nev. 215
In the Matter of Stan PHILIPIE on Petition for a Writ of Habeas Corpus.
No. 5101.
Supreme Court of Nevada.
May 31, 1966.
*950 Albert M. Dreyer, of Las Vegas, for Petitioner.
Richard Breitwieser, City Attorney of Reno, and Samuel T. Bull, Assistant, for Respondent.

OPINION
COLLINS, Justice.
Petitioner was arrested for violation of Reno Municipal Code, Sec. 12-76.[1] He was distributing handbills[2] in front of the Horseshoe Club in downtown Reno as a picket engaged in a strike against the club. Following arrest, he was admitted to bail and released. He sought an original writ of habeas corpus from this court, contending the ordinance to be unconstitutional. The writ issued to Elmer Briscoe, Chief of Police, City of Reno, commanding him to make return on the writ. The return indicated petitioner was not in custody, having been released on bail, and the City of Reno moved to dismiss the application on that ground. We thus have two issues presented by application for the writ and motion to dismiss:
(1) May a person admitted to bail seek a writ of habeas corpus?
(2) If the writ will lie, is the ordinance unconstitutional?
On the first question we have concluded a person arrested, who seeks to test the constitutionality of the ordinance or statute under which he is arrested, even though admitted to bail, is entitled to apply for a writ of habeas corpus. Habeas corpus is always available to one in custody or restrained of his liberty to test the constitutionality of an ordinance or statute. Ex parte Rosenblatt, 19 Nev. 439, 14 P. 298 *951 (1887); Ex parte Boyce, 27 Nev. 299, 75 P. 1 (1904); Ex parte Kair, 28 Nev. 127, 80 P. 463 (1905). Nevada law allows one committed on a criminal charge, who seeks a writ of habeas corpus, if the offense is bailable, to be released on a recognizance. NRS 34.540. This court has previously held that a writ of habeas corpus may be utilized to test the legality of the restraint of one on probation. Garnick v. Miller, 81 Nev. 372, 403 P.2d 850 (1965).
It seems compelling to us, and of the greatest logic, that if a statute or ordinance under which a person is arrested and held to stand trial is unconstitutional, there should never be a trial. No sound reason has been advanced why a person arrested thereunder, though admitted to bail, may not urge such contention. The California Supreme Court has ruled that habeas corpus is available to a person on bail regardless of the reason and has construed their statute to hold that a person on bail is restrained of his liberty, with actual detention or custody not being required for the writ to lie. In re Petersen, 51 Cal.2d 177, 331 P.2d 24 (1958). We are not yet prepared to go that far, but limit our holding to the facts presented in this case. We recognize there are many authorities holding a contrary view, but their reasoning is not entirely persuasive.
We now turn to the question of the constitutionality of the ordinance. The acts of a legislative body (here the Mayor and City Council of Reno) are presumed to be valid until it is clearly shown that they violate some constitutional restriction. Ex parte Boyce, 27 Nev. 299, 75 P. 1 (1904); State v. Lincoln Co. P.D., 60 Nev. 401, 111 P.2d 528 (1941); Viale v. Foley, 76 Nev. 149, 350 P.2d 721 (1960). Does the ordinance, under which petitioner was arrested, clearly show some constitutional restriction? We hold that it does. The Constitution of Nevada, Art. 1, Sec. 9, and of the United States (First Amendment made applicable to the states by the Fourteenth Amendment to the Federal Constitution) forbid impairment of freedom of speech. This does not mean such right may not be regulated under the police powers of the state or federal governments, but it cannot be forbidden entirely. Schneider v. State, 308 U.S. 147, 60 S.Ct. 146, 84 L.Ed. 155 (1939).
There are many United States Supreme Court cases, involving the distribution of handbills, which hold that any ordinance prohibiting the distribution on the streets of materials expressing ideas political, social or economic are unconstitutional. Lovell v. Griffin, 303 U.S. 444, 58 S.Ct. 666, 82 L.Ed. 949 (1938), struck down an ordinance by which a Jehovah's Witness was convicted of passing out literature on a city street without having obtained written permission of the city manager. Hague v. Committee for Industrial Organization, 307 U.S. 496, 59 S.Ct. 954, 83 L.Ed. 1423 (1939), held unconstitutional an ordinance prohibiting the distribution of handbills. Schneider v. State, supra, dealt with ordinances of four cities: A Los Angeles ordinance prohibited the distribution of any handbill on any street; a Milwaukee ordinance prohibited anyone from circulating or distributing any handbill or other printed or advertising matter on a city street; a Worcester, Massachusetts, ordinance absolutely prohibited the distribution of any handbill of any sort on any city street; and an Irvington, New Jersey, ordinance required written permission from the chief of police.
In Talley v. California, 362 U.S. 60, 80 S.Ct. 536, 4 L.Ed.2d 559 (1959), Mr. Justice Black, speaking for the court, stated precisely the constitutional importance of the right to distribute handbills when he said:
"Anonymous pamphlets, leaflets, brochures and even books have played an important role in the progress of mankind. Persecuted groups and sects from time to time throughout history have been able to criticize oppressive practices and laws either anonymously or not at all."
It is true a municipality or other governmental body may, under its police power, enact ordinances or laws to regulate, *952 control or prohibit purely commercial advertising. Valentine v. Chrestensen, 316 U.S. 52, 62 S.Ct. 920, 86 L.Ed. 1262 (1942). Respondent, City of Reno, argues that its ordinance, quoted in the footnote above, can be construed by this court as having only that purpose. As it is worded however, it purports to preclude distribution of any handbill or dodger circular, even though it does include the words "or other advertisement." We do not assume legislative powers, but feel the Mayor and City Council of Reno are able to draft and enact such ordinance as will reflect the will of their inhabitants regulating the distribution of commercial handbills. There is precedent for such ordinance. New York Sanitation Code 3118, as construed in Valentine v. Chrestensen, supra; People v. Johnson, 117 Misc. 133, 191 N.Y.S. 750 (1921); People v. La Rollo, 24 N.Y.S.2d 350 (1940); People v. Healy, 74 N.Y.S.2d 102 (1947).
Accordingly, the writ of habeas corpus is made permanent, petitioner is released from restraint and his bond exonerated.
THOMPSON, J., and ZENOFF, District Judge, concur.
NOTES
[1]  "12-76 It shall be unlawful to distribute or cause to be distributed or thrown upon any street, sidewalk or public place, or in or upon any private premises within the City of Reno any handbill, dodger circular or other advertisement."
[2]  "AMERICAN FEDERATION OF CASINO AND GAMING EMPLOYEES 325 West Street Room 202 Local 55 Reno, Nevada. Notice to the Public. Exodus 23:1 `You shall not repeat a false report. Do not join the wicked in putting your hand, as an unjust witness, upon anyone.' This is an informational picket line. Its purpose is to inform the public of a labor dispute. The American Federation of Casino and Gaming Employees is chartered by the State of Nevada, registered with the LMR and recognized as a collective bargaining agent by the National Labor Relations Board.

"Exodus 23:6 `You shall not deny one of your needy fellow men his rights in his lawsuit.' The management of the Horseshoe Club have continually intimidated, threatened and fired employees for their sympathy for and membership in our organization. Our pickets do not eat in the Horseshoe Club.
"Levitous 19:13 `You shall not defraud or rob your neighbor. You shall not withhold overnight the wages of your day laborer.:'
"Remember the Sermon on the Mount  `Blessed are those who hunger and thirst for justice sake for they shall be satisfied.'"
