His lawyer argued that an order imposed on the sex offender contravened his human rights.
Greens was released from custody earlier this year – and Lothian and Borders Police were given unrestricted access to him to stop him re-offending.
Lawyer Tony Kelly argued that the 23 individual restrictions on his client’s liberty – which included not coming into contact with women – prevented him from living a normal life.
But Sheriff Paul Arthurson, QC, said there were good reasons for Greens, who has been diagnosed as a psychopath, to be monitored. The judge agreed to allow the order and refused the right to appeal.
The sheriff made the decision after police accepted it was impossible to prevent Greens from having absolutely no contact with women. The court recognised that Greens may have unavoidable encounters with women in the street or in shops and would allow him not to be penalised for them.
Greens was recently housed in Dalkeith, Midlothian, but was removed after demonstrations by local residents.