
60 Cal.App.2d 546 (1943)
JUANITA McCARTHY, Respondent,
v.
CITY OF OAKLAND et al., Appellants.
Civ. No. 12480. 
California Court of Appeals. First Dist., Div. One.  
Sept. 24, 1943.
 F. B. Fernhoff, City Attorney, and John W. Collier, Assistant City Attorney, for Appellants.
 Joseph A. Brown, Alexander Mooslin and A. E. Cross for Respondent.
 WARD, J.
 The plaintiff Juanita McCarthy, brought this suit against the city of Oakland and the Board of Trustees of the Police Relief and Pension Fund of that city, seeking the issuance of a writ of mandate commanding and requiring the board to resume payment to her of a pension which theretofore had been paid for a certain period but had been discontinued, and directing its payment during her natural life. The trial court gave judgment in her favor, and the defendants have appealed.
 One J. F. McCarthy, a member of the Police Department of the city of Oakland for some years, was killed in the performance of his duty, whereupon Juanita McCarthy, his widow, in accordance with the provisions of the Oakland Charter, was granted a pension of $75 a month, one-half of the salary attached to decedent's rank, to be paid her as long as she remained a widow. It is admitted that she has not remarried. A subsequent increase in the salary of patrolman raised the pension to the sum of $100 a month. At the time of the death of respondent's husband and for some time prior thereto he had been assessed or had contributed to the pension fund.
 On January 12, 1940, plaintiff was convicted of three felonies, viz., conspiracy to commit burglary and theft, burglary of the first degree and burglary of the second degree, and sentenced to imprisonment. Upon appeal the conviction was upheld. (People v. McCarthy, 45 Cal.App.2d 278 [114 P.2d 24].)
 Prior to the filing of this action consent was obtained therefor. (Pen. Code, sec. 2600.) At the time of her conviction, and also when this action was commenced, namely, on June 25, 1940, the city charter contained a provision to the effect that "Any member of the police department receiving a pension *549 from the police relief and pension fund, who shall become convicted of a felony ... shall forfeit all right to said pension." (Stats. 1911, p. 1610.) Subsequent to plaintiff's conviction the board, on December 22, 1940, passed a resolution reciting the conviction and striking Juanita McCarthy's name from the pension roll, since which time accordingly no further payments have been made to her. In 1941 the section of the charter containing the above quoted provision was amended by substituting the words "Any person" for "Any member of the police department." (Stats. 1941, p. 3399; sec. 96, subd. (3) of the charter.)
 The appellants in their attack upon the judgment make two contentions, namely, that the payment of a pension to respondent in the present situation would be contrary to public policy; and, second, that the respondent, seeking the equitable relief of a writ of mandate, has not come into court with clean hands.
 Against these contentions the respondent urges (1) that her right to a pension is predicated upon contract and that such right has become vested; (2) that the requirement of equity that a petitioner for relief must come into court with clean hands has no application to this case since the criminal acts set up by the appellants as a bar to granting the relief sought had no connection with the facts and circumstances which constitute the foundation of her right to be paid the pension.
 [1] The payment of pensions to "those dependent and near and dear to police officers, is intended to provide a reward for long, courageous and faithful performance of duty." (Mott v. Scanlan, 19 Cal.App. 250 [125 P. 762].) Had petitioner, a felon in a state penitentiary, been a member of the police department, the courts must, under the present charter provision, have held that she had forfeited her right to a reward for the faithful performance of duty and denied her right to a pension. As to a widow the charter provisions must also prevail.
 [2] Public policy is sometimes declared by judicial decision, but where a legislative body having jurisdiction over pension rights has enacted specific provisions on the subject, the public policy on that subject is established thereby. Even in such a case as the present, if the controlling rule operates unjustly the remedy lies with such legislative authority. (Jordan v. Retirement Board, 35 Cal.App.2d 653 [96 P.2d 973].) *550 Whatever the courts may think about the matter from the standpoint of policy they are powerless to interfere.
 [3] A pension law may be repealed changed or modified. All jurisdictions are in accord with this rule, [4] but California with a small minority adheres definitely to the doctrine that when one becomes eligible to be, and is in fact, placed on a pension roll, a vested right accrues of which the pensioner may not be deprived. (Klench v. Board of Pension Fund Commrs., 79 Cal.App. 171 [249 P. 46].) In later cases the happening of "the contingency" which causes the vesting is emphasized, and it has been determined that the vested right is not to a specific sum but that the pension may be increased or decreased in accordance with the rank of the pensioner at the time of retirement. (Brooks v. Pension Board, 30 Cal.App.2d 118 [85 P.2d 956]; Carr v. Fire Commission, 30 Cal.App.2d 208 [85 P.2d 959]; Jordan v. Retirement Board, supra; Murphy v. City of Piedmont, 17 Cal.App.2d 569 [62 P.2d 614, 64 P.2d 399]; Casserly v. City of Oakland, 6 Cal.2d 64 [56 P.2d 237].) In Whitehead v. Davie, 189 Cal. 715 [209 P. 1008], it was held that an amendment to a pension law may be retroactive if the intent to this effect be clear. The Whitehead case was approved in Sweesy v. L. A. etc. Retirement Bd., 17 Cal.2d 356 [110 P.2d 37 ].
 [5] Many of the pension laws in this state are based primarily upon the rule that rewards will be given for the faithful performance of future services, but pensions are granted also for duties already performed. That they are in the nature of a gratuity is recognized in Lamb v. Bd. of Peace Officers, 29 Cal.App.2d 348 [84 P.2d 183]. However, in the Sweesy case, supra, in referring to the Lamb case, the court said (p. 363): "In that case there was no applicable pension system in existence at the time the officer was retired for disability resulting from performance of duty. The answer to the question whether a pensionable status may be created retroactively to include persons who had already been retired may not afford a guide in resolving the question whether an amendment to the pension law may afford additional benefits by way of a widow's pension to members who already had acquired a retired pensionable status under the law. It does not follow that because the pension would be a gratuity in the one case, it also is in the other."
 If the majority rule in other jurisdictions--that a pension is a gratuity--could be followed under the facts herein, some color would be given appellants' contention that a continuation *551 of the pension payments to respondent is against public policy. At least it could be held that the amendment to the charter, providing that a pension cease whenever "any person" receiving the benefit thereof is convicted of a felony, was operative from the date of the approval of the amendment. In Gibbs v. Minneapolis Fire Dept. Relief Ass'n., 125 Minn. 174 [145 N.W. 1075, Ann.Cas. 1915C 749], a case approved almost universally in other jurisdictions, the pension law was amended in effect so as to the exclude a widow who had deserted her husband, etc. In that case the widow was not dependent on the husband during the latter part of his life but conducted a house of ill fame. Approving the rule that a pension is a gratuity, the court there held that a pension payment already accrued can not be taken away but that, as against the State, there is no vested right accruing from month to month in the future. The Gibbs case, however, was specifically disapproved in Klench v. Board of Pension Fund Commrs., supra, page 184. (Dryden v. Board of Pensions Commrs., 6 Cal.2d 575 [59 P.2d 104].)
 [6] In the present case, the charter provision (Stats. 1911, p. 1610) directing that a pension right be forfeited if a "member" of the department shall become convicted of a felony, prevails. The language used in the amendment of 1941 (Stats. 1941, p. 3399), providing that "any person" receiving a pension, who shall become convicted of a felony, shall forfeit all rights to such pension, is not retroactive (Clarke v. Police Life etc. Ins. Board, 127 Cal. 550 [59 P. 994]; Kavanagh v. Board of Police P. F. Commrs., 134 Cal. 50 [66 P. 36]; Holmberg v. City of Oakland, 55 Cal.App. 270 [203 P. 167]; O'Dea v. Cook, 176 Cal. 659 [169 P. 366]; Jordan v. Retirement Board, supra), and therefore of no avail to appellant city. Likewise the contention that this particular pension should be controlled by a previous act of the Legislature (Stats. 1889, p. 56) is without merit.
 In Dillon v. Board of Pension Commrs., 18 Cal.2d 427 [116 P.2d 37, 136 A.L.R. 800], a proceeding in mandamus by a widow to compel the payment to her of a pension, the court held that her cause of action accrued at the time of the death of her husband, and that the widow's right to receive a pension is a continuing one. In Dryden v. Board of Pension Commrs., supra, it was stated that a pension right becomes vested in a "member" upon acceptance of employment, and in a widow upon the death of her husband. [7] Whatever has been said in the numerous decisions in this state, a liberal *552 construction in favor of the pensioner should be given. (McKeag v. Board of Pension Commrs., 21 Cal.2d 386 [132 P.2d 198].) [8] It must be held by an intermediate reviewing court that although a pensioner has no right to a specific sum, which may be changed, whatever rights exist are vested, subject to specified contingencies. (Klench v. Board of Pension Fund Commrs., supra; O'Dea v. Cook, supra; Jordan v. Retirement Board, supra; Sweesy v. L. A. etc. Retirement Bd., supra; Brooks v. Pension Bd., supra; Casserly v. City of Oakland, supra; Aitken v. Roche, 48 Cal.App. 753 [192 P. 464]; Dryden v. Board of Pension Commrs., supra.) At the time the right of respondent to the pension accrued, there was no contingency for forfeiture upon conviction of a felony.
 [9] The clean hands doctrine may be invoked in a mandamus proceeding. (Dierssen v. Civil Service Commission, 43 Cal.App.2d 53 [110 P.2d 513].) It is true that the present litigation arose as a result of the refusal to continue monthly pension payments because of the recipient's commission of felonies. [10] However, the rule does not apply if the wrong doing is unconnected with the matter before the court. The commission of the felonies herein had no connection with the award of the pension when the right thereto accrued, subject to specified contingencies. "The maxim that 'He who comes into a court of equity must do so with clean hands,' has reference to the particular transaction, in which relief is sought, and not to the general morals or conduct of the person seeking such relief." (W. U. Tel. Co. v. Commercial Pac. C. Co., 177 Cal. 577, 585 [171 P. 317]; City of Los Angeles v. Watterson, 8 Cal.App.2d 331 [48 P.2d 87].) Relief is not to be denied because of general iniquitous conduct on the part of a complainant. (19 Am.Jur., p. 327, sec. 473; Miller & Lux v. Enterprise etc. Co., 142 Cal. 208, 213 [75 P. 770, 100 Am.St. Rep. 115].)
 In view of the foregoing, it is not necessary to consider Penal Code sections 2600, 2601 and 2604 as applied to respondent's present status as a felon.
 The judgment is affirmed.
 Peters, P. J., and Knight, J., concurred.
