I'll add my 2 cents here, for what it's worth:
I have a current state police-issued security guard license. While state laws will likely differ, I doubt that they do that much.
The issue of operating unlawfully seems to be in significant question, esp in light of whether there was posted signage or not, regardless of anything posted on the interweb.
A security guard may
ask for ID, but there's no requirement to comply. There is
certainly & absolutely no cause, reason, or justification for any sort of physical contact, nor the same regarding any attempt to detain.
It appears to me that a security guard does not fall under the definition of those to whom you must show your Part 107 documentation.
Oftentimes, there's simply the matter of principle.
I don't know if that security guard called for assistance, whether it being from an associate, or LEOs.
What the security guard
should have done:
Be polite, inform the OP that he was in violation, request that he cease & desist, & if necessary, to leave the premises.
Document his observation, either via recording or writing, of the details of the encounter, & if needed, call the police.
That's it. Security guards
are not LEOs!
Any question of if, or to what extent, the OP was in violation is
far overshadowed by the unquestionably gross misconduct & violations of law committed by that security officer.
I would highly recommend documenting via a medical professional(s) any injuries the OP might have received, physically, psychologically & emotionally, & do that ASAP.
Go have, at least, a consultation with a competent attorney with some sort of experience with such matters.
Photographer's Right