I’ve never seen Codes of Conduct as attempting to prevent (no more than any other lists of prohibited activity actually prevent such activities), but more to be an automatic defense for the organizers when they have to kick someone out for misbehaving.
Every restaurant I have ever been to seems to have a sign saying "We reserve the right to refuse service." They also sometimes say "No shirt, no shoes, no service." That's about it.
Somehow, they don't seem to typically have big problems with people behaving badly while having lunch or whatever.