CAL. WIC. CODE § 340 : California Code - Section 340

Whenever a petition has been filed in the juvenile court alleging that a minor comes within Section 300 and praying for a hearing thereon, or whenever any subsequent petition has been filed praying for a hearing in the matter of the minor and it appears to the court that the circumstances of his or her home environment may endanger the health, person, or welfare of the minor, or whenever a dependent minor has run away from his or her court ordered placement, a protective custody warrant may be issued immediately for the minor. 340.5. (a) Whenever pursuant to Article 10 (commencing with Section 360) a social worker is assigned to provide child welfare services, family reunification services, or other services to a dependent child of the juvenile court, the juvenile court may, for good cause shown and after an ex parte hearing, issue its order restraining the parents of the dependent child from threatening the social worker, or any member of the social worker's family, with physical harm.

(b) For purposes of this section, "good cause" means at least one threat of physical harm to the social worker, or any member of the social worker's family, made by the person who is to be the subject of the restraining order, with the apparent ability to carry out the threat.

(c) Violation of a restraining order issued pursuant to this section shall be punishable as contempt.