This is sort of related to this other question but in this case it is about a cell phone and about entering a government (IRS) office.
I visited an IRS field office in Worcester (Massachusetts, USA) a couple of years back and had a somewhat off-putting experience with their security guard asking to see my cell phone. As in, "in order for you to get in here, I want you to hand over your cell phone".
The request seemed a bit weird but as I had a need to talk to IRS personnel, I gave him my phone. The phone was one of those Nokia N900 smart phones. He turned it on, fiddled with the screen a bit (I thought at that time that maybe he was trying to scroll it to see what apps I had on it), and gave it back to me.
This guard was not an official law enforcement person (police officer or sheriff or anything like that) but from some private security company.
Anyway, this experience came up in a discussion later and what I wanted to know is what the U.S. (or MA) law says about requests to see another person's cell phone.
In USA, or MA, would a security guard at an IRS office be legally allowed to demand to see my cell phone?