A life sentence prisoner has secured High Court permission to challenge an alleged ban on consensual sex within Northern Ireland's jails.
The man, who cannot be identified, was granted leave to seek a judicial review of the perceived prohibition, along with the denial of access to condoms and other aids.
He claims the failure to provide items for protection from sexually transmitted infections (STIs) amounts to a breach of human rights.
A judge ruled that his legal action should advance to a full hearing later this year and granted him anonymity.
The prisoner taking the action describes himself as a gay man who wants to engage in sexual activity with other inmates at HMP Maghaberry.
He is challenging the non-provision of condoms, lubricants, disinfectant tablets and information about the risks of STIs.
In proceedings issued against the Northern Ireland Prison Service, his lawyers also contend there is an unwritten "position" that prisoners are forbidden from consensual sex.
According to their case the relevant rules stipulate that an inmate will be guilty of a disciplinary offence if he "commits an indecent or obscene act".
The man taking the case described that view as prejudiced and offensive.
He claims the authorities have wrongly asserted that restrictions on his right to engage in sexual activity is a feature of incarceration.
"In fact, I have significant opportunity to engage in consensual sexual relationships with other prisoners during our imprisonment in a manner that maintains both our and other prisoners' privacy, and which is neither indecent nor obscene," he stated in court papers.
"Nor do I believe it to be realistic to assert that prisoners will not engage in consensual sexual activity.
"Many prisoners can and do engage in such sexual activity during imprisonment."
Denying access to the items being sought will simply prevent inmates from taking steps to protect their health and life, he alleged.
Based on written arguments, Mr Justice Colton granted leave to apply for a judicial review, with the case expected to be heard in November.
Outside court the man's solicitor, Gavin Booth of Phoenix Law, said: "These proceedings involve important sexual health issues for all prisoners, who should be entitled to the same preventative measures as other members of society.
"This has been a taboo subject for too long, but in reality consensual relationships happen in prisons, and appropriate steps should be taken to facilitate safe sexual measures."