The California Supreme Court on Monday unanimously upheld the right of prosecutors to introduce evidence about the secrets of sex offenders, but refused to allow them to obtain the secrets of journalists.

In one of the cases, prosecutors got the okay from the state high court to present evidence about a defendant’s history of sex crimes to jurors hearing sex offense cases.