
4 Cal.Rptr.3d 475 (2003)
111 Cal.App.4th 1087
Christina JOHNSON, Plaintiff and Appellant,
v.
COUNTY OF FRESNO et al., Defendants and Respondents.
No. F041054.
Court of Appeal, Fifth District.
September 3, 2003.
Review Denied December 17, 2003.[*]
*477 Law Offices of Wagner & Jones and Andrew B. Jones, Fresno; Law Office of John K. Ormond and John K. Ormond IV, Fresno, for Plaintiff and Appellant.
McCormick, Barstow, Sheppard, Wayte & Carruth, Michael G. Woods, Joseph R. Becerra, Fresno, and Todd W. Baxter, for Defendants and Respondents.


*476 OPINION
WISEMAN, J.
Getting a grasp of this case requires a trip through a procedural maze culminating in a nonintuitive result, a journey for which we beg the reader's indulgence. Christina Johnson filed a complaint against the County of Fresno and one of its employees, Michael Stribling, alleging claims for sexual harassment, negligence and other torts. Stribling worked for the County's Department of Health and was Johnson's treating counselor. Alleging that Stribling made sexual advances toward her (among other things), Johnson filed a complaint against the County and Stribling. The County denied Stribling any defense, reasoning that he acted outside the course and scope of his employment. On the day set for the hearing of the County's motion for summary judgment on this issue, Johnson dismissed the County out of the lawsuit, with prejudice. Johnson later entered into a stipulated judgment in the amount of $165,000 with Stribling, who, predictably, admitted his contact with Johnson occurred during the course and scope of his employment with the County. The errant employee, Stribling, then assigned to Johnson his right to pursue indemnification from the County. Johnson then filed a complaint against the County seeking indemnification (on behalf of Stribling) from the County and agreed not to try to collect against Stribling for 18 months.
Irritated, the County filed a demurrer which was sustained without leave to amend. The trial court opined that our holding in Rivas v. City of Kerman (1992) 10 Cal.App.4th 1110, 13 Cal.Rptr.2d 147 precluded Johnson's recovery because the County refused to provide a defense. Johnson appeals, arguing Government Code section 825.2 provides a potential basis for her recovery.
We conclude section 825.2 permits a public employee to seek indemnification from his employer for a stipulated judgment where the employer has refused to provide a defense on the ground the employee was not acting within the scope of his employment. Recognizing the County's frustration in being sued by a party that originally dismissed it out with prejudice and who is now in alliance with an alleged sexual aggressor, we are reminded of William Shakespeare's character, Trinculo, from The Tempest, who lamented: "misery acquaints a man with strange bedfellows."[1]

DISCUSSION
Johnson argues that the court erred in sustaining the demurrer without leave to amend based on the following grounds: 1) section 825.2 allows for a public employee's recovery from his employer even where the employer has declined to provide a defense to the employee because the employee was allegedly acting outside the scope of his employment; and/or 2) Government Code sections 825 and 825.2 do not provide the exclusive basis under *478 which a public entity may be required to provide indemnity for the acts of its employees.
"In reviewing a judgment of dismissal after a demurrer is sustained without leave to amend, we must assume the truth of all facts properly pleaded by the plaintiff ..., as well as those that are judicially noticeable." (Howard Jarvis Taxpayers Assn. v. City of La Habra (2001) 25 Cal.4th 809, 814, 107 Cal.Rptr.2d 369, 23 P.3d 601.) Here, the issues are predominantly legal.

I. Application of sections 825 and 825.2
Johnson contends that section 825.2 allows for a public employee's recovery from his employer even where the employer has declined to provide a defense. We first review the relevant Government Code provisions.
Section 825, subdivision (a), states:
"(a) Except as otherwise provided in this section, if an employee or former employee of a public entity requests the public entity to defend him or her against any claim or action against him or her for an injury arising out of an act or omission occurring within the scope of his or her employment as an employee of the public entity and the request is made in writing not less than 10 days before the day of trial, and the employee or former employee reasonably cooperates in good faith in the defense of the claim or action, the public entity shall pay any judgment based thereon or any compromise or settlement of the claim or action to which the public entity has agreed."
Section 825.2, in turn, provides:
"(a) Subject to subdivision (b), if an employee or former employee of a public entity pays any claim or judgment against him, or any portion thereof, that the public entity is required to pay under [s]ection 825, he is entitled to recover the amount of such payment from the public entity.
"(b) If the public entity did not conduct his defense against the action or claim, or if the public entity conducted such defense pursuant to an agreement with him reserving the rights of the public entity against him, an employee or former employee of a public entity may recover from the public entity under subdivision (a) only if he establishes that the act or omission upon which the claim or judgment is based occurred within the scope of his employment as an employee of the public entity and the public entity fails to establish that he acted or failed to act because of actual fraud, corruption or actual malice or that he willfully failed or refused to conduct the defense of the claim or action in good faith or to reasonably cooperate in good faith in the defense conducted by the public entity." (See also § 995.2, subd. (a)(1) [public entity may refuse to provide defense for employee if it determines act or omission was not within scope of employee's employment].)
Both parties rely on our holding in Rivas v. City of Kerman, supra, 10 Cal.App.4th 1110, 13 Cal.Rptr.2d 147, in support of their positions. In Rivas, a public entity declined to defend its employee on the ground the employee was not acting within the scope of his employment. The plaintiffs entered into a stipulated judgment with the employee, who assigned to the plaintiffs all claims he had against his employer. The plaintiffs then filed an action for declaratory relief, alleging that section 825 required the public entity to pay the stipulated judgment on the employee's behalf. We held that section 825 does not compel a public entity to pay a judgment entered against its employee unless the public entity provided the employee's defense. (Rivas v. City of *479 Kerman, supra, 10 Cal.App.4th at pp. 1113-1114, 13 Cal.Rptr.2d 147.)
In reaching our conclusion, we addressed the relationship between sections 825 and 825.2. The analysis is useful here:
"The language of section 825 clearly indicates the section is applicable only if the public entity provides a defense for the employee.... [¶] That the phrase `the defense' in paragraph one refers to a defense provided by the public entity is ... supported by the language used in section 825.2 in which, inter alia, it is specifically stated the employee must `conduct the defense of the claim or action in good faith or to reasonably cooperate in good faith in the defense conducted by the public entity [italics added]' in order to be entitled to recover any sums he or she has expended to satisfy a judgment arising out of his or her employment with a public entity. `Under well-established principles of statutory construction, these interrelated provisions must be construed together and harmonized if possible. [Citation.] ... [W]hen the same word or phrase is used, it should be given the same meaning in the related part of the law.' [Citation.] Section 825 and section 825.2 are part of one comprehensive statutory framework and are inextricably interwoven; therefore, the phrase `the defense' should be construed in section 825 to have the same meaning as that explicitly given it by the Legislature in section 825.2.
"... Therefore, construing the language of section 825 to give meaning to every word and phrase and in harmony with related statutes mandates the conclusion that the statute is directly applicable only when the public entity provides the employee's defense. [¶] ... [¶]
"... Sections 825 and 825.2 were enacted in 1963 as part of article 4, a package of legislation concerning governmental liability for torts committed by its employees. Section 825.2 is applicable to situations in which a public entity declines to defend an employee and ensures the employee will be held harmless against claims arising out of the scope and course of his employment with the public entity.
"... Section 825.2 anticipates the situation in which the public entity did not conduct the defense of the employee by expressly providing that in such situations, the employee is entitled to recovery if he complies with the requirements of subdivision (b). Pursuant to subdivision (b), the employee will be held harmless by the public entity employer if he proves he was acting within the scope and course of his employ and the public entity does not prove the employee acted because of actual fraud or malice or that the employee did not defend against the claim in good faith.
"To hold that section 825 applies even if the public entity does not defend the employee would permit [the plaintiffs] to compel the [public entity] to pay the stipulated judgment without proof that [the employee] acted within the scope and course of his employ or without giving the public entity a chance to demonstrate that he acted with actual malice ..., thus permitting [the employee] to circumvent the protections for public entities contained in section 825.2, subdivision (b) .... [¶] ... [¶]
"... [I]f the public entity declines to defend the employee and judgment is entered against him or her, and the employee subsequently satisfies the requirements of subdivision (b) of section 825.2, the employee will be held harmless by the public entity.... [¶] ... [¶]
"Public policy considerations also support limitation of section 825 to those *480 situations in which the employee was defended by the public entity.... If section 825 were interpreted to include situations in which the public entity declined an employee's request for defense, the public entity would have no protection against an employee's stipulated judgment and would be required to pay such a judgment in full even though the issue of whether the employee acted with fraud or malice or whether he or she was acting within the scope of his or her employment had never been determined.... [¶]... [¶]
"Thus, the language of section 825 itself, the surrounding statutory framework, persuasive legal authority and public policy considerations all support the conclusion that section 825 is inapplicable when the public entity declines to provide a defense; instead, the employee must look to section 825.2."[2] (Rivas v. City of Kerman, supra, 10 Cal.App.4th at pp. 1116-1120, 1122-1124, 13 Cal.Rptr.2d 147, fns. omitted.)
Here, in contrast to Rivas, Johnson did look to section 825.2 for indemnification. Johnson received an assignment of Stribling's claim against the County under section 825.2, subdivision (b). She did not file a declaratory relief action seeking to enforce the judgment against the County under section 825, subdivision (a). In order to prevail on her claim, Johnson must satisfy the requirements set forth in section 825.2, subdivision (b). She must prove Stribling was acting within the scope of his employment, and the County must fail to prove Stribling acted because of actual fraud, corruption or malice or that Stribling did not defend against the claim in good faith. Literal payment of the judgment by Stribling is not required. (See Rivas v. City of Kerman, supra, 10 Cal.App.4th at pp. 1120-1121, 13 Cal.Rptr.2d 147.)
Citing to Rivas, the County argues that it cannot be bound by a stipulated judgment to which it did not agree. This is not the holding in Rivas. We find nothing in the language of section 825.2 to suggest that it does not apply to a stipulated judgment. Nor do we note any public policy considerations that would restrict the application of section 825.2 to stipulated judgments. The County's concern that such an interpretation invites fraud and/or collusion between the employee and the alleged victim is alleviated by the very language in section 825.2  the employee must have conducted a defense of the claim in good faith. Were the employee to collude with the victim, the public entity could prove the employee did not defend against the claim in good faith and would therefore not be required to hold the employee harmless.
The employer may be at risk to indemnify the employee for a stipulated judgment to which it did not agree. However, this is the inherent risk an employer faces in deciding whether to deny a defense. In other words, if the employer is confident the employee was acting outside the scope of his employment, the risk is relatively slight. If the employer believes the employee may well be found to have acted in the scope of his employment, and still denies a defense, the employer bears a greater risk of having to indemnify for a stipulated judgment to which it did not agree. The employer can act accordingly in deciding whether to unconditionally defend, defend *481 with a reservation, or refuse to defend the employee.
Public policy, in fact, weighs in favor of applying section 825.2 to stipulated judgments. If we preclude such an application, we discourage settlements and force public employees to fully litigate the claims against them in cases where their employers refuse to provide a defense. Only then could the employees seek indemnification under section 825.2. We would be subjecting employees to uncertain liability, including costs and attorney fees, if they wanted to later pursue indemnification from their employers. Nothing in the language of section 825.2 requires public employees to litigate the claims against them or deprives public employees of the opportunity to settle. This interpretation would impose a requirement not intended by the Legislature and frustrate the very purpose of the statute. (See Rivas v. City of Kerman, supra, 10 Cal.App.4th at p. 1116, 13 Cal.Rptr.2d 147 [statutes must be interpreted in accord with plain meaning of language used and words to be given ordinary commonsense meaning unless to do so would frustrate the manifest purposes of the legislation as a whole or lead to absurd results].) The right of a public employee to petition for a writ of mandate to compel the public entity to provide a defense does not alter the analysis. (See Govt.Code § 996.4.)
Thus, if a judgment, including a stipulated judgment, is entered against a public employee after his employer declined to defend him, and the employee subsequently satisfies the requirements of section 825.2, subdivision (b), he or she is entitled to recover from his employer for the judgment.

II. Resolution of the issue of course and scope of employment
The County maintains that the court nonetheless properly sustained the demurrer because 1) whether Stribling was acting within the course of his employment has already been decided against Johnson; and 2) the facts, as provided by Johnson, establish that Stribling was not acting within the course of his employment as a matter of law.[3] We disagree.

A. Johnson's dismissal of the County
The County argues that, under the doctrines of res judicata and collateral estoppel, its dismissal with prejudice by Johnson is determinative of whether Stribling was acting in the course of his employment. The County maintains that since both Stribling and the County were parties to the underlying suit, both are bound by Johnson's dismissal with prejudice of the cause of action against the County for vicarious liability. The County's analysis is flawed.
A dismissal with prejudice bars a subsequent action on the same claim between the parties and their privies. And a consequent judgment of dismissal is a final judgment on the merits, entitled to res judicata effect. (Rice v. Crow (2000) 81 Cal.App.4th 725, 733-735, 97 Cal.Rptr.2d 110; see also Wells v. Marina City Properties, Inc. (1981) 29 Cal.3d 781, 789, 176 Cal.Rptr. 104, 632 P.2d 217.) In addition, at least one case has held that a dismissal with prejudice also bars the plaintiff from asserting affirmative defenses in a separate lawsuit based on issues raised in the dismissed action. (Torrey Pines Bank v. Superior Court (1989) 216 Cal.App.3d 813, 821-822, 265 Cal.Rptr. 217; but see Walsh *482 v. West Valley Mission Community College Dist. (1998) 66 Cal.App.4th 1532, 1545-1547, 78 Cal.Rptr.2d 725 [Torrey Pines opinion does not preclude party who dismisses his action with prejudice from contesting allegations in separate lawsuit arising out of same operative facts as dismissed claim].)
A dismissal with prejudice is a judgment on the merits between the plaintiff and the dismissed defendant. It is not, however, a judgment on the merits between the plaintiff and other defendants in the action. "[D]ue process requires that before an issue can be held established as to a party based on a previous determination in the action as to other parties, the party to be bound must have been afforded notice and an opportunity to contest the previous determination and an incentive to do so." (Long Beach Grand Prix Assn. v. Hunt (1994) 25 Cal.App.4th 1195, 1203, 31 Cal.Rptr.2d 70 [plaintiff's voluntary dismissal of defendant did not bar remaining defendant's indemnity claim against dismissed defendant]; see also Atherley v. MacDonald, Young & Nelson (1955) 135 Cal.App.2d 383, 385, 287 P.2d 529["[I]n no event is a judgment in an action in which the parties were not adversaries, but only joined as codefendants, res judicata as between them in a later proceeding."].) If certain statutory prerequisites are met, a plaintiff is absolutely entitled to have a dismissal entered. Neither the clerk nor the trial court has any discretion in the matter, and the other defendants have no grounds to prevent the dismissal or to set it aside. As a result, it is fundamentally unfair to allow the dismissed defendant to use the dismissal with prejudice to bar the remaining defendants from litigating claims against it. (Long Beach Grand Prix Assn. v. Hunt, supra, 25 Cal.App.4th at p. 1203, 31 Cal.Rptr.2d 70.)
Thus, Stribling is not barred from seeking indemnity against the County based on Johnson's dismissal of the County with prejudice. Because Stribling assigned his indemnification rights against the County to Johnson, Johnson now "stands in Stribling's shoes." An assignment carries with it all the rights of the assignor. (1 Witkin, Summary of Cal. Law (9th ed. 1987) Contracts, § 947, p. 843; see also Teater v. Good Hope Dev. Corp. (1942) 55 Cal.App.2d 459, 462, 130 P.2d 812 [enforcement of assignor's rights by assignee depends upon rights of assignor].) "The assignment merely transfers the interest of the assignor. The assignee `stands in the shoes' of the assignor, taking his rights and remedies, subject to any defenses which the obligor has against the assignor prior to notice of the assignment." (1 Witkin, supra, Contracts, § 948, p. 844.) Once a claim has been assigned, the assignee is the owner and has the right to sue on it. (See National R. Co. v. Metropolitan T. Co. (1941) 17 Cal.2d 827, 832-833, 112 P.2d 598; Code Civ. Proc., § 368.5 [action or proceeding does not abate by the transfer of an interest].) In fact, once the transfer has been made, the assignor lacks standing to sue on the claim. (See Purcell v. Colonial Ins. Co. (1971) 20 Cal.App.3d 807, 814, 97 Cal.Rptr. 874.)
We recognize that, through this assignment, Johnson has received something to which she would not otherwise be entitled. All we can say is, welcome to the world of assignments.

B. Johnson's complaint
The County also argues that Stribling's alleged actions of misconduct were not in the course and scope of his employment as a matter of law. We cannot make such a finding.
"`Ordinarily, the determination whether an employee has acted within the *483 scope of employment presents a question of fact; it becomes a question of law, however, when "the facts are undisputed and no conflicting inferences are possible."' [Citation.]" (Lisa M. v. Henry Mayo Newhall Memorial Hospital (1995) 12 Cal.4th 291, 299, 48 Cal.Rptr.2d 510, 907 P.2d 358.) The California Supreme Court explained the standard for respondeat superior liability:
"The nexus required for respondeat superior liability  that the tort be engendered by or arise from the work  is to be distinguished from `but for' causation. That the employment brought tortfeasor and victim together in time and place is not enough. We have used varied language to describe the nature of the required additional link (which, in theory, is the same for intentional and negligent torts): the incident leading to injury must be an `outgrowth' of the employment [citation]; the risk of tortious injury must be `"inherent in the working environment"' [citation] or `"typical of or broadly incidental to the enterprise [the employer] has undertaken"' [citation].
"Looking at the matter with a slightly different focus, California courts have also asked whether the tort was, in a general way, foreseeable from the employee's duties. Respondeat superior liability should apply only to the types of injuries that' "as a practical matter are sure to occur in the conduct of the employer's enterprise."' [Citation.] The employment, in other words, must be such as predictably to create the risk employees will commit intentional torts of the type for which liability is sought." (Lisa M. v. Henry Mayo Newhall Memorial Hospital, supra, 12 Cal.4th at pp. 298-299, 48 Cal.Rptr.2d 510, 907 P.2d 358, fn. omitted.)
Here, Johnson asserts claims against Stribling for sexual battery, sexual harassment and negligence, among others. We cannot decide, as a matter of law, that Stribling was not acting in the course of his employment based on the allegations in Johnson's complaint for indemnity. The issue is better left to a motion for summary judgment.
As a result of our decision, it is unnecessary to address Johnson's remaining ground of error.

DISPOSITION
The judgment of dismissal is reversed. The trial court shall enter an order overruling the demurrer. Costs are awarded to Johnson.
WE CONCUR: HARRIS, Acting P.J., and BUCKLEY, J.
NOTES
[*]   Baxter, J., dissented.
[1]  The Tempest, act II, scene II, line 41.
[2]  In Rivas, we acknowledged that the plaintiffs did not argue that section 825.2 was applicable, presumably because they would be unable to establish that the employee was acting within the course and scope of his employment. (Rivas v. City of Kerman, supra, 10 Cal.App.4th at p. 1118, fn. 10, 13 Cal.Rptr.2d 147.)
[3]  The County also argues that Johnson improperly changed her theory on appeal. The record does not support this contention.
