F. Upon a finding that the harm to privacy of the person in interest or dangers of unwarranted adverse consequences outweigh the public interest in retaining the records, the court may order such records, or any part thereof except basic identification information, to be sealed. If the court finds that neither sealing of the records nor maintaining of the records unsealed by the agency would serve the ends of justice, the court may enter an appropriate order limiting access to such records. Any order entered under this subsection shall specify those agencies to which such order shall apply. Any order entered pursuant to this subsection may be appealed by the petitioner, the prosecuting agency, the arresting agency, or the Oklahoma State Bureau of Investigation to the Oklahoma Supreme Court in accordance with the rules of the Oklahoma Supreme Court. In all such appeals, the Oklahoma State Bureau of Investigation is a necessary party and must be given notice of the appellate proceedings.