Education and Training Act 2020, ss 106
A teacher can make you hand over an item if they believe (on “reasonable grounds”) that you have something that is likely to:
endanger someone’s safety, or
have a negative or disruptive effect on the school’s learning environment.
The teacher can only do this if:
you have the item in clear view, or
they think (for a good reason) you’re hiding it in your pockets or somewhere else on you, or in a bag or container.
If the item (like a picture) is on your computer or phone, the teacher can get you to show them the item or get you to hand over the device.
The teacher can’t search you directly, or use any physical force. If you refuse to hand over the item, the school can take reasonable disciplinary steps.