A couple agreed to move out of their home so a grandparent could move in and care for their four children after social workers raised concerns.
They agreed to visit the youngsters, aged between 11 and two, only during the daytime when the grandparent was there.
Detail of the move has emerged in a ruling by a judge following a private family court hearing.
Judge Clifford Bellamy said the arrangement was temporary and the couple had signed a written agreement drawn up by social services staff.
He said social workers had intervened when the couple, who had a long-standing history of drug abuse, were arrested following a police raid.
"It was subsequently agreed that the children should be cared for by their maternal grandmother," said the judge.
"To enable her to care for them she moved into the children's home and the parents moved out.
"The parents were not allowed to have unsupervised contact with the children.
"They were only allowed to be in the home between 7am and 7pm to support the grandmother in caring for the children.
"These arrangements were intended to be a temporary measure. They were supported by a written agreement."
Judge Bellamy, who oversaw the case at a family court in Derby, said he had been asked to make rulings on the children's long-term futures.
He said social workers proposed placing the youngsters either for adoption or in long-term foster care.
The judge said final decisions had yet to be made and the children could not be identified.
Copyright (c) Press Association Ltd. 2017, All Rights Reserved.