I wouldn't consider letting out a fart anymore inappropriate than excusing oneself to go to the bathroom, but doing either in a way that you know will disrupt and cause coworkers discomfort is inappropriate and harassing, not because of the act itself, but because of how you handle it.
I'd say it's something like "involving people without their consent" - e.g. farting on them.
Which includes forcing people to listen to tales of your sexual exploits.
So if we sit next to each other and I keep farting even though you don't like it, it's not harassment because it's not directed at you, but if I kept walking over to your area just to fart, that's harassment.
I would have thought the distinction would be obvious considering the overlap between HN readers and the socially awkward.