You’ve never worked in a secure facility where sign away the right to refuse searches have you? I can take you directly to a Raytheon facility miles from my house where at 5:00pm the employees form a double line at security where their briefcases and bags are opened and searched before they can leave. Is it legal? You betcha, because all the employees gave Raytheon permission as a condition of their employment. That makes it consensual, and a consensual search is never unreasonable before the law.
“all the employees gave Raytheon permission as a condition of their employment.”
I am not sure I would equate gaining access to a defense department facility with not being able to keep a gun in your car in a parking lot at Disney World or a Medical School.
For example, I never signed squat about searches or anything else except how to divvy up the money I earned and they were going to steal.