Why are casino security personnel allowed to break the law?

I’m studying law, and read a book that illustrates how casino security are allowed to violate a casino patron’s rights when the win too much money certain games (like blackjack). This includes illegally detaining them, physical/verbal harassment, and unlawful searches.

HOW are they able to get away with this? Even when it’s brought to court, they are rarely acknowledged of committing these violations of the law