It's up to , public opinion , politicians, law makers , judges , and jurors , to decide if its legal. And yourself if its morally correct.
I couldn't just walk down the road and murder a stranger , as it would be illegal, and morally reprehensible , but , if we still had capital punishment in this country , I could hang child rapists all day long , and wouldn't lose a minutes sleep over it.