But he agreed that the man, known only as Alan, should not be allowed to have sex with anyone on the grounds that he did not have the mental capacity to understand the health risks associated with his actions.