You mean, assuming it happened? It's probably not permitted. It'd fall under the category of cruel and unusual punishment, or maybe extrajudicial punishment. Plenty of things happen that are not permitted.
But it's much more complex than this. There's a question of how much we want to prevent such things, and, even supposing we're willing, how many resources we're willing to dedicate to the solution. There's also a question of prevention via cultural change, which is a hard problem if there ever was one.