(a)
Notwithstanding any other law concerning public hearings and records, a hearing or trial held under this part may be held in closed court without admittance of any person other than those necessary to the action or proceeding. Except as provided in subdivision (b), all papers and records, other than the final judgment, pertaining to the action or proceeding, whether part of the permanent record of the court or of a file in a public agency or elsewhere, are subject to inspection and copying only in exceptional cases upon an order of the court for good cause shown.
(b)
Papers and records pertaining to the action or proceeding that are part of the permanent record of the court are
subject to inspection and copying by the parties to the action, their attorneys, and by agents acting pursuant to written authorization from the parties to the action or their attorneys. An attorney shall obtain the consent of the party to the action prior to authorizing an agent to inspect and copy the permanent record. An attorney shall also state on the written authorization that he or she has obtained the consent of the party to authorize an agent to inspect and copy the permanent record.