When is it morally acceptable to use violence in political/social protest?

Related, what is a "just war"?

I think there's some literature on the topic.