Title 17, Chapter 5, Section 28
In the execution of the search warrant the officer executing the
same may reasonably detain or search any person in the place at the
(1) To protect himself from attack; or
(2) To prevent the disposal or concealment of any instruments,
articles, or things particularly described in the search warrant.