
46 Cal.2d 845 (1956)
GEORGE J. LYNN, Appellant,
v.
SHERMAN P. DUCKEL, as Director of Public Works, etc., Respondent.
S. F. No. 19220. 
Supreme Court of California. In Bank.  
July 24, 1956.
 John J. Dailey for Appellant.
 Dion R. Holm, City Attorney (San Francisco), and George E. Baglin, Deputy City Attorney, for Respondent.
 McCOMB, J.
 Plaintiff appeals from a judgment in favor of defendant after trial of an action instituted to obtain (1) a mandatory injunction directing defendant to remove obstructions erected in and across the entrance to Argent Alley from Market Street in San Francisco, and (2) damages resulting from the obstruction of the entrance to the alley.
 Argent Alley is a 10-foot public alley on the east slope of Twin Peaks in San Francisco, connecting Market and Corbett Streets. It is too steep and narrow for vehicular use, and since its dedication by recordation of a subdivision map in 1867 the public has always used it solely as a pedestrianway. It is the sole route for pedestrians between Market and Corbett Streets without going two blocks out of their way. Six other alleys in the same area, all dedicated at the same time, have always been used exclusively as pedestrianways. *847
 The following photograph is a view of the alley looking in a westerly direction from its intersection with Market Street:
 Graphic Material Omitted
 On November 1, 1951, plaintiff bought a house and lot at 4512 23d Street. The rear of this lot, which contained a large depression, abuts on Argent Alley. At that time Argent Alley was impassable to vehicles.
 Plaintiff, without the required permit from the city's department of public works (defendant herein), brought a bulldozer into the alley and graded many tons of earth out of it, *848 and used the earth to fill in and level off his lot. He then commenced running trucks in the alley from Market Street to his property. This resulted in the alley being impassable to pedestrians.
 Residents of the district complained to defendant, who found the condition existing to be dangerous to the public, halted plaintiff's running of trucks in the alley by removing a ramp and bringing the Market Street sidewalk up to the official grade, and installed a 4-inch iron post imbedded in concrete at the entrance to the alley.
 Plaintiff then applied to defendant for a permit to build a paved roadway in the alley. This was denied. Plaintiff did not appeal to the city's board of permit appeals, but instead instituted the instant action. After trial without a jury the trial court made the following findings of fact  [fn. *]: (1) the alley was dedicated to public use as a pedestrianway; (2) the running of vehicles therein was dangerous to the public; and (3) plaintiff, because of his unlawful disregard of the city's permit procedure, did not come into court with "clean hands," and therefore was not entitled to relief. Judgment was accordingly rendered for defendant.
 Questions
 [1] First: Was plaintiff's cause of action barred by the fact that he did not exhaust his administrative remedy prior to instituting the present suit?
 Yes. Section 106 of the San Francisco Charter, which became effective January 8, 1932 (Stats. 1931, p. 3041), reads: "The director of public works shall have and succeed to the powers and duties of the Board of Public Works from and after twelve o'clock noon on the 8th day of January, 1932."
 Article VI, chapter I, section 9, subdivision 1 of San Francisco's Charter of 1900 (Stats. 1899, pp. 286-287) read:
 "The Board of Public Works shall have charge, superintendence and control, under such ordinances as may from time to time be adopted by the supervisors:"
 "1. Of all public ways, streets, avenues, lanes, alleys, places, courts, roads, highways and boulevards now opened or which may hereafter be opened in the city and county; of the manner of their use; and of all work done upon ... the same; and herein particularly the board shall have exclusive authority to prescribe rules and grant permits, in conformity *849 with the ordinances of the supervisors, for ... the using of the street or any portion thereof ... for any purpose other than such as ordinarily and properly belongs to the public from the dedication thereof to public use, and without such permission in writing from said Board no person shall do any of the acts in this section enumerated; ...."
 Section 24 of the San Francisco Charter, effective in 1932 (Stats. 1931, pp. 2991-2992), read: "The board of supervisors shall regulate, by ordinance, the issuance ... of ... permits for the use of ... public streets and places, .... Permits ... shall be issued by the departments as designated by ordinance, only after formal application for such permit. ... If any application for a permit ... is denied by the department authorized to issue same, the applicant may appeal to the board of permit appeals."
 Section 39 of the San Francisco Charter of 1932 (Stats. 1931, pp. 3001- 3002) read: "Any applicant for a permit ... who is denied such a permit ... by the department authorized to issue same ... or any person who deems that his interests or property or that the general public interest will be adversely affected as the result of operations authorized by or under any permit ... granted or issued by any department, may appeal to the board of permit appeals. Such board shall hear the applicant, the permit-holder, or other interested parties, as well as the head or representative of the department issuing or refusing to issue such ... permit ... After such hearing and such further investigation as the board may deem necessary, it may concur in the action of the department authorized to issue such ... permit, or, by the vote of four members, may overrule the action of such department and order that the permit ... be granted ... or refused."
 Section 335 of the San Francisco Public Works Code reads in part: "It shall be unlawful for any person ... to make ... any excavation in ... the surface of any public ... alley ... without first obtaining from the Department of Public Works a written certificate that such person ... is entitled to make such excavation. ..."
 In view of the foregoing provisions of the city charter, it is apparent that after plaintiff was denied a permit to build a paved roadway in the alley administrative procedure required that he apply to the city's board of permit appeals. This he failed to do, and the established rule is here applicable that one is not entitled to judicial relief until the prescribed *850 administrative remedy is not only invoked but exhausted. (United States v. Superior Court, 19 Cal.2d 189 at 194 [1] [120 P.2d 26]; Abelleira v. District Court of Appeal, 17 Cal.2d 280 at 291 [5] [109 P.2d 942, 132 A.L.R. 715]; Myers v. Bethlehem Shipbuilding Corp., 303 U.S. 41, 50 et seq. [58 S.Ct. 459, 82 L.Ed. 638]; cf. Lindell Co. v. Board of Permit Appeals, 23 Cal.2d 303, at 314 [144 P.2d 4].)
 Hence, the trial court properly found that since plaintiff did not exhaust his administrative remedies he was not entitled to judicial relief.
 Second: Was plaintiff properly denied relief because he did not come into court with "clean hands"?
 Yes. [2] The rule is settled in California that whenever a party who, as actor, seeks to set judicial machinery in motion and obtain some remedy, has violated conscience, good faith or other equitable principle in his prior conduct, then the doors of the court will be shut against him in limine; the court will refuse to interfere on his behalf to acknowledge his right, or to afford him any remedy. (DeGarmo v. Goldman, 19 Cal.2d 755 at 764 [5] et seq. [123 P.2d 1]; Bowman v. Bowman, 125 Cal.App. 602 at 612 [5] [13 P.2d 1049, 14 P.2d 558].)
 [3] The foregoing rule is applicable to the facts presented in the instant case. The record discloses that plaintiff, without written permit and in violation of the San Francisco Public Works Code, graded Argent Alley so as to make it available for vehicular traffic when it had been previously used solely for pedestrian traffic. By grading a roadway into the alley without a permit, plaintiff circumvented the city's permit procedure established for the protection of the public. Upon either the granting or denial of a permit, the procedure provided for an appeal to the board of permit appeals--by the applicant if the permit was denied; or, if granted, by any person who deemed his interests or property would be adversely affected as the result of operations under the permit.
 By ignoring the city's permit procedure and building the road without a permit, then suing defendant, the Director of Public Works, for a mandatory injunction, plaintiff attempts to nullify the procedure established by law, denies the public the hearing to which it is entitled, and flouts the public interest which the procedure was designed to protect. Obviously the public, whom defendant represents, was injured by plaintiff's illegal conduct and the "clean hands" doctrine applies to him. *851
 [4] Third: Was defendant estopped because of certain unauthorized acts of employees of the city and county of San Francisco from asserting its rights to claim that plaintiff had not complied with the statute relative to changing Argent Alley into a vehicular street?
 No. In 1924 Argent Alley was a path for pedestrians. At that time Market Street in the vicinity of the seven alleys (including Argent) was being improved under contract.
 The grade of the sidewalk in front of Argent Alley had been established by the board of supervisors as being level with the walk on each side, with no depression therein. The official plans called for the curb in front of Argent Alley and the other six alleys to be continuous, without the customary break and turning in of the curbs found at intersecting vehicular ways, and for a concrete stairway to rise from the street level to the sidewalk level in front of Argent Alley.
 A city civil service examiner named Zion owned property at the northwest corner of Market Street and Argent Alley. He requested the city's engineering department, instead of building the concrete stairs as called for by the plans, to "build this ramp up here so that we could use it for our property to move in."
 Without change in the official plans or change in the sidewalk grade established by the supervisors, the engineering department personnel caused the contractor to build a ramp where stairs were called for, to shift the stairs 10 feet south, and to build a 10-to 12-inch depression in the outer half of the sidewalk to accommodate the ramp and keep a vehicle ascending the ramp from hanging up on the edge of the sidewalk. The continuous curb was not changed, but a triangular asphalt plug was inserted between the curb and the street so a vehicle could cross the curb.
 It is contended that this unlawful construction for Zion's benefit and Zion's vehicular use of the alley for 15 years constituted public acceptance of Argent Alley for vehicular use (although the public had used it exclusively as a pedestrianway since 1867) and therefore the unauthorized conduct of the engineering department raised an estoppel against the public and in favor of plaintiff.
 Such is not the law. Mr. Chief Justice Gibson, in County of San Diego v. California Water & Tel. Co., 30 Cal.2d 817 at 826 [186 P.2d 124, 175 A.L.R. 747], thus accurately states *852 the rule: "It is clear, however, that neither the doctrine of estoppel nor any other equitable principle may be invoked against a governmental body where it would operate to defeat the effective operation of a policy adopted to protect the public. (Citations.)" (Simons Brick Co. v. City of Los Angeles, 182 Cal. 230 at 237 [4] [187 P. 1066]; Gardella v. County of Amador, 164 Cal. 555 at 564 [129 P. 993]; see also cases cited in 10 Cal.Jur. (1923), p. 652, Estoppel, note 4.)
 It is thus evident that the doctrine of estoppel was not available to plaintiff under the facts of the present case.
 The judgment is affirmed.
 Gibson, C.J., Traynor, J., and Spence, J., concurred.
 CARTER, J.
 I dissent.
 Where a municipal corporation has closed a street to vehicle traffic by placing an obstruction therein, an owner of property abutting on the street may have preventive relief against the closing and is not barred by the clean hands rule or exhaustion of administrative remedies since his act in partially grading the street has no connection with the closing and he has no administrative remedy for the closing.
 The majority opinion holds that plaintiff, the property owner, may not obtain equitable relief for the closing of the street because: (1) He did not have clean hands; and (2) he did not exhaust his administrative remedies, allegedly afforded by the city.
 Before discussing the grounds of the majority opinion, let us examine the facts as they appear in the evidence and in the findings of the trial court. Plaintiff acquired his property in 1951. It has a house on it which fronts on 23d Street in the middle of the block between Corbett and Market Streets. Twenty-third Street, while a public street, has never been graded for use by either pedestrian or vehicular traffic because it is too steep. Hence plaintiff has no access, pedestrian or vehicular, at the front of his property and none to the rear except as hereinafter appears. The rear of his lot abuts on Argent Alley, a duly established public street, and the one here in question. It runs parallel to 23d Street. Argent is steep but passable for vehicles from Market Street to the rear of plaintiff's lot. From there on to Corbett Street there are steps for use by pedestrians. Plaintiff, finding Argent filled with debris, obtained permission of defendant, head of the department of public works, to clean it up and had a bulldozer *853 work one day on it, pushing the debris and dirt into a hole on plaintiff's land. Argent became muddy and defendant objected. On further conversation with men in defendant's department, it was agreed that plaintiff would put crushed rock on the surface of Argent, and he was told by defendant he needed no further authority to do so. The rock was accordingly spread on Argent by plaintiff. Thereafter defendant tore out the ramp over the curb at the intersection of Argent with Market Street and placed a post in the middle of the entrance to Argent. Contrary to the statement in the majority opinion, Argent was used for both pedestrian and vehicular traffic from 1922 to 1939, although it was not so used thereafter until plaintiff commenced so to use it after he acquired his property. When a contractor paved Market Street in 1922, the owner of property on Market and along Argent requested the engineer in the department of public works that a ramp or gutter plug be put in so that vehicles could get over the curb and onto Argent. This was done and the city paid for it. Plaintiff apparently applied to defendant for a permit to pave Argent after he had cleaned out the debris, but his request was denied and he did not appeal to the city board of permit appeals.
 We have a situation, then, in which plaintiff used Argent, a public street, as it was supposed and fixed to be used in entire good faith believing that he had the approval of defendant Duckel and his department. Defendant then proceeded to close Argent to vehicular traffic by physically making it impossible for a vehicle to enter it. Plaintiff then brought this action seeking the aid of the court to have the obstruction removed. The majority here denies him relief for the reasons heretofore stated.
 Plaintiff should not be denied relief because of unclean hands as there was no connection between the transaction, grading of Argent and the closing of it, and he acted in entire good faith, having the approval of those in charge of defendant's department. It is said in Treager v. Friedman, 79 Cal.App.2d 151, 173 [179 P.2d 387], quoting from Carman v. Athearn, 77 Cal.App.2d 585, 598 [175 P.2d 926]: "As stated in Carman v. Athearn, 77 Cal.App.2d 585, at page 598 [175 P.2d 926]; 'The misconduct which brings the "clean hands" doctrine into operation must relate directly to the transaction concerning which complaint is made. The misconduct must infect the cause of action before the court. *854 Relief is not denied because the plaintiff may have acted improperly in the past or because such prior misconduct may indirectly affect the problem before the court. A party may have relief in connection with a transaction itself untainted although his original title may have been tainted by improper conduct. These principles are well settled. (See Germo Mfg. Co. v. McClellan, 107 Cal.App. 532 [290 P. 534]; Bradley Co. v. Bradley, 165 Cal. 237 [131 P. 750]; Western Union Tel. Co. v. Commercial Pac. C. Co., 177 Cal. 577 [171 P. 317]; 2 Pomeroy's Equity Jurisprudence (5th ed.), p. 94,  399; cases collected 30 C.J.S. p. 491,  98 (c); 4 A.L.R. 44 at p. 65.)' " (See also Western Union Tel. Co. v. Commercial Pac. Cable Co., 177 Cal. 577 [171 P. 317]; Watson v. Poore, 18 Cal.2d 302 [115 P.2d 478]; Hamrick v. Hamrick, 119 Cal.App.2d 839 [260 P.2d 188]; Boericke v. Weise, 68 Cal.App.2d 407 [156 P.2d 781]; McCarthy v. City of Oakland, 60 Cal.App.2d 546 [141 P.2d 4]; Miller & Lux v. Enterprise etc. Co., 142 Cal. 208 [75 P. 770, 100 Am.St.Rep. 115]; Germo Mfg. Co. v. McClellan, 107 Cal.App. 532 [290 P. 534]; Bradley Co. v. Bradley, 165 Cal. 237, 242 [131 P. 750]; City of Los Angeles v. Watterson, 8 Cal.App.2d 331 [48 P.2d 87].) Here the only unlawful act charged against plaintiff is that he graded Argent without obtaining a permit, but that does not mean that he cannot complain of the closing of Argent. They are unrelated transactions. If the conclusion of the majority is correct, any time a citizen commits some minor infraction with reference to public streets, he may be forever barred from objecting to the closing of a street because he has unclean hands. The closing was not the result of the grading of the street. It was an arbitrary action on defendant's part because he thought it was unsafe to permit vehicular traffic on Argent.
 The majority lumps together plaintiff's grading of Argent with his alleged failure to exhaust an administrative remedy as showing lack of clean hands. Certainly failure to exhaust is not a showing of unclean hands and as will later appear herein, plaintiff had no administrative remedy.
 On the question of exhaustion of remedies, the majority refers to plaintiff's failure to appeal to the board of permit appeals after his application for a permit to pave Argent was denied. No application was made for anything else and the paving would have no effect on the closing of Argent. Even if he had obtained a permit to pave, defendant would still have closed Argent. Hence there was no administrative *855 remedy available to him which touched upon the question of closing. It is crystal clear, as it should be, that: "In all of the cases in this state in which it has been held that a party had not exhausted his administrative remedies and therefore was not entitled to relief by the court, provision was made in the governing law for a proceeding of some nature before an administrative body which the party had not pursued. (Abelleira v. District Court of Appeal, 17 Cal.2d 280 [109 P.2d 942, 132 A.L.R. 715]; Metcalf v. County of Los Angeles, 24 Cal.2d 267, 269 [148 P.2d 645], and cases cited therein.) It is only when no mode of attacking the validity of an ordinance is provided other than by resort to the courts, that a court will take jurisdiction. Where an ordinance contains provisions looking to the prevention of hardship upon owners in particular cases, resort to the administrative agency is required. We have not been cited to any case, and we have found none, holding that resort must be had to an administrative agency when the agency has no power to act. In a number of cases where an ordinance prohibited the doing of a particular act in a specific district, direct application to the courts for relief has been permitted and the ordinance held unconstitutional. Apparently in these cases there was no provision for a variance in the ordinance. The question whether an administrative remedy should have been exhausted was not urged or discussed. It seems clear, however, that it was not done because there was no administrative remedy to pursue." (Bernstein v. Smutz, 83 Cal.App.2d 108, 115 [188 P.2d 48].) Here the charter and ordinances of San Francisco do not purport to give anyone the right to confer special permission to use Argent, and the paving of it, as seen, has no relation to the closing of it. There is no law which gives the defendant, director of public works, any power to close a street or to issue permits for the customary and usual use to which streets are put such as vehicular and pedestrian traffic; his power is limited to permits to use streets for purposes other than the customary ones. The charter provisions as set forth in the majority opinion only give the director superintendence and control over the streets and expressly provide that permits for using them may be granted for any purpose "other than such as ordinarily and properly belongs to the public." There can be no question that use of streets for vehicular traffic belongs to the public and hence the director has no authority to grant or deny a permit in connection *856 with such use. Therefore, in arbitrarily closing Argent he usurped his power and authority and plaintiff is clearly entitled to the relief here prayed for.
 I would reverse the judgment.
 Shenk, J., concurred.
NOTES
[fn. *]  *. Plaintiff does not question the sufficiency of the evidence to sustain the trial court's findings of fact.
