Good lord! Teachers really are above the law 
This is long, but the bits relevant to this thread are in bold.
From www.education.gov.uk/aboutdfe/advice/f0076897/screening-searching-and-confiscation
Screening, searching and confiscation
Searching
School staff can search a pupil for any item if the pupil agrees.
Headteachers and staff authorised by them have a statutory power to search pupils or their possessions, without consent, where they have reasonable grounds for suspecting that the pupil may have a prohibited item.
Prohibited items are:
? knives or weapons
? alcohol
? illegal drugs
? stolen items
? tobacco and cigarette papers
? fireworks
? pornographic images
? any article that the member of staff reasonably suspects has been, or is likely to be used:
i) to commit an offence
ii) to cause personal injury to, or damage to the property of, any person (including the pupil)
Headteachers and authorised staff can also search for any item banned by the school rules which has been identified in the rules as an item which may be searched for.
Confiscation
School staff can seize any prohibited item found as a result of a search. They can also seize any item, however found, which they consider harmful or detrimental to school discipline.
The power to seize and confiscate items ? general
What the law allows:
? Schools? general power to discipline, as set out in Section 91 of the Education and Inspections Act 2006, enables a member of staff to confiscate, retain or dispose of a pupil?s property as a disciplinary penalty, where reasonable to do so.
? The member of staff may use their discretion to confiscate, retain and/or destroy any item found as a result of a ?with consent? search so long as it is reasonable in the circumstances. Where any article is thought to be a weapon it must be passed to the police.
? Staff have a defence to any complaint or other action brought against them. The law protects members of staff from liability in any proceedings brought against them for any loss of, or damage to, any item they have confiscated provided they acted lawfully.
Statutory guidance for dealing with electronic devices
- Where the person conducting the search finds an electronic device they may examine any data or files on the device if they think there is a good reason to do so. Following an examination, if the person has decided to return the device to the owner, or to retain or dispose of it, they may erase any data or files, if they think there is a good reason to do so.
- The member of staff must have regard to the following guidance issued by the Secretary of State12 when determining what is a ?good reason? for examining or erasing the contents of an electronic device:
? In determining a ?good reason? to examine or erase the data or files the staff member must reasonably suspect that the data or file on the device in question has been, or could be, used to cause harm, to disrupt teaching or break the school rules.
- If inappropriate material is found on the device it is up to the teacher to decide whether they should delete that material, retain it as evidence (of a criminal offence or a breach of school discipline) or whether the material is of such seriousness that it requires the involvement of the police.