A B.C. Supreme Court judge has struck down Abbotsford bylaws that prohibit homeless people from erecting temporary shelters and sleeping in city parks.

Chief Justice Christopher Hinkson ruled that not allowing the homeless to sleep in parks constitutes a violation of Section 7 of the Canadian Charter of Rights and Freedom which ensures the right to security of the person.

The 81 page judgment did attempt to put a limit on permanent homeless encampments in public parks.

"I conclude that allowing the City's homeless to set up shelters overnight while taking them down during the day would reasonably balance the needs of the homeless and the rights of other residents of the City," wrote Hinkson.

"The evidence shows, however, that there is a legitimate need for people to shelter and rest during the day and no indoor shelter in which to do so. A minimally impairing response to balancing that need with the interests of other users of developed parks would be to allow overnight shelters to be erected in public spaces between 7:00 p.m. and 9:00 a.m. the following day."

The lawsuit was filed by the B.C./Yukon Association of Drug War Survivors with the help of the Pivot Legal Society after city workers spread chicken manure on one homeless camp, and police pepper-sprayed residents and slashed tents at another.

Abbotsford Mayor Bruce Banman apologized for the chicken manure incident, but said the camps were a safety issue and had to go.

​At the hearing this summer, Abbotsford's lawyers told the court that the local homeless population chooses to sleep outside rather than in available shelters, while the Pivot Legal Society argued it's wrong to blame the homeless for their circumstances.

It's the second time the high court has struck down a municipal bylaw aimed at preventing homeless people from setting up tents and sleeping in city parks.

In Oct of 2008, the B.C. Supreme Court threw out a Victoria bylaw, ruling it deprived the homeless of life, liberty and security of the person in violation of the Charter — a ruling later upheld by the B.C. Court of Appeal.