New guidelines for schools go close to the margins of the law in order to give principals the powers they say they need to keep their schools free of drugs and weapons.
The guidelines published on Wednesday clarify the law for schools and allow breathalysing, drug-testing and searches by drug dogs.
Principals had been worried they would lose those powers after changes to the Education Act in 2013.
Patrick Walsh from the Secondary Principals' Association was chairperson of the group that developed the guidelines and says it took 10 iterations to reach the final version.
"We've been working very closely with the legal division of the Ministry of Education and also with Crown Law Office and I think that's worked well. So we have sailed close to the law."
Principals who have seen the guidelines are generally happy with them, he says.