
1 Cal.App.4th 793 (1991)
2 Cal. Rptr.2d 403
DAVID ANTHONY BARBER et al., Petitioners,
v.
THE SUPERIOR COURT OF BUTTE COUNTY, Respondent; THE PEOPLE, Real Party in Interest.
Docket No. C012069.
Court of Appeals of California, Third District.
November 27, 1991.
*794 COUNSEL
Latimer & Kenkel, Jerry J. Kenkel and Dennis R. Hoptowit for Petitioners.
No appearance for Respondent.
Daniel E. Lungren, Attorney General, George Williamson, Chief Assistant Attorney General, Robert R. Anderson, Acting Assistant Attorney General, *795 J. Robert Jibson, and William G. Prahl, Deputy Attorneys General, for Real Party in Interest.
OPINION
PUGLIA, P.J.
An information filed in respondent superior court charges that "On or about October 21, 1990" petitioners violated "PENAL CODE SECTION 278.5(b)."[1] Petitioners (defendants) seek a writ of prohibition restraining further prosecution (Pen. Code, § 999a) after the superior court denied their motion to dismiss on the ground that the preliminary hearing evidence does not support the charge. (Pen. Code, § 995.) We conclude that defendants' conduct does not, as a matter of law, constitute a violation of Penal Code section 278.5, and shall grant relief.
(1) In reviewing an order denying a motion to set aside an information on the ground of insufficiency of the evidence, we may not substitute our judgment for that of the magistrate as to the weight of the evidence or the credibility of witnesses. Every legitimate inference must be drawn in favor of the information, and as long as there is some rational ground for assuming the possibility that an offense has been committed and the accused is guilty of it, the prosecution must be allowed to proceed. (See Rideout v. Superior Court (1967) 67 Cal.2d 471, 474 [62 Cal. Rptr. 581, 432 P.2d 197].) However, where there is no evidence at the preliminary hearing of an essential element of the offense, dismissal is required. (Garabedian v. Superior Court (1963) 59 Cal.2d 124, 127 [28 Cal. Rptr. 318, 378 P.2d 590].) Such is the case here.
Since this matter was submitted at the preliminary hearing on a stipulated set of facts, there is no question of weighing the evidence. Insofar as they are relevant to the present petition, those facts are as follows. In September 1990, the Butte County Juvenile Court, in a dependency proceeding brought under Welfare and Institutions Code section 300, ordered the two minor children of defendants detained outside the family home. The minors were subsequently adjudged dependents of the juvenile court and, on October 19, 1990, dispositional orders were issued. Certain provisions included in each of those orders form the basis for the present charge, to wit: "7. The care, *796 custody, control and conduct of the minor be under the supervision of the Child Protective Services division of the Butte County Welfare Department," and, "8. The minor be placed, under the supervision of Child Protective Services, in the home of her mother." Defendants were forbidden to remove the children from the state of California without authorization from child protective services (CPS). Defendants also signed a service plan agreement which, inter alia, required defendant David Barber to live outside the family residence until CPS recommended otherwise.
Later in October 1990, defendants left the state with the children, going to Florida and then Antigua. Warrants were issued for defendants' arrest, and in May 1991, defendants surrendered themselves to the Butte County authorities. It is this removal of the children from California without authorization from the juvenile court or CPS that the People contend violates Penal Code section 278.5.
Penal Code section 278.5 provides: "Every person who has a right to physical custody of or visitation with a child pursuant to an order, judgment or decree of any court which grants another person, guardian, or public agency right to physical custody of or visitation with that child, and who within or without the state detains, conceals, takes, or entices away that child with the intent to deprive the other person of that right to custody or visitation shall be punished ..." by imprisonment or a fine.
(2) Defendants contend there is no evidence of an essential element of the charged offense, viz, that there was "another person, guardian, or public agency [with the] right to physical custody of or visitation with" their minor children pursuant to court order. The People argue that the juvenile court's dispositional orders granted a right of physical custody to CPS, and that defendants' flight from the state was intended to infringe on that right. We conclude that on the agreed facts, defendants have the better of the argument.
To resolve this matter, we need look no farther than Penal Code section 278.5 itself and the section which immediately follows it. Penal Code section 279, subdivision (f), contains the following language: "For purposes of sections 277, 278, and 278.5: [¶] (1) `A person having a right of custody' means the legal guardian of the child, a person who has a parent and child relationship with the child pursuant to section 197 of the Civil Code, or a person or an agency that has been granted custody of the child pursuant to a court order. [¶] (2) A `right of custody' means the right to physical custody of the child...." The combined provisions of sections 278.5 and 279 thus unambiguously require that a violation of the former can be premised only *797 on conduct which intended to interfere with the right of a person or agency that has been granted "physical custody" or "visitation."
To establish this element of the offense, the People necessarily rely upon the previously quoted provision in the dispositional orders which grants CPS "supervision" over the care and custody of the minors. We find it unnecessary to address the parties' various contentions and theories regarding the meaning of this specific terminology or the nature of the juvenile court's role as parens patriae in dependency actions. It suffices to point out that whatever authority over the minors was vested in CPS by the juvenile court, the agency was not granted physical custody. Moreover the orders did not confer on CPS any specific right to visitation. Therefore, defendants' conduct in taking their minor children from the state did not violate Penal Code section 278.5.
Let a writ of prohibition issue restraining respondent superior court from taking any further action in the pending prosecution except to dismiss the information. Upon finality of this decision, the stay previously issued will be vacated.
Marler, J., and Raye, J., concurred.
The petition of real party in interest for review by the Supreme Court was denied February 19, 1992.
NOTES
[1]  Penal Code section 278.5, was amended in 1989. Subdivision (b) was eliminated, but the section as revised retains the provisions of former subdivision (b). (Stats. 1989, ch. 1428, § 4; People v. Flora (1991) 228 Cal. App.3d 662, 667 [279 Cal. Rptr. 17].) The parties have indicated their awareness of this change, and defendants have voiced no objection to the information's erroneous reference to a nonexistent section subdivision. Accordingly, we shall presume it is understood that the information effectively charges a violation of Penal Code section 278.5, as amended, and we shall henceforth refer to the revised provisions.
