Kan. Stat. Ann. § 22-2509
In the execution of a search warrant the person executing the same may reasonably detain and search any person in the place at the time:
L. 1970, ch. 129, § 22-2509; July 1.