A San Francisco judge on Thursday dismissed a lawsuit brought by retired judges who say a policy that places a lifetime cap on the number of days they can serve temporarily in state trial courts is discriminatory.

Superior Court Judge Ethan Schulman said the retired judges failed to state a constitutional claim and could not recover damages for the judiciary’s “discretionary acts” in administering the temporary assigned judges program.