(1) This section applies to a detainee if:
(a) he or she is held in immigration detention in a prison or remand centre of a State or Territory; and
(b) a law of that State or Territory confers a power to search persons, or things in the possession of persons, serving sentences or being held in the prison or remand centre.
(2) To the extent that the State or Territory law confers that power, or affects the exercise of that power, it applies to the detainee as though it were a law of the Commonwealth.
(3) Sections 252AA and 252A of this Act do not apply to a detainee to whom this section applies.