Is Humanitarian Intervention Legal?

Where collective security avenues are blocked, could a State, or States acting jointly, lawfully intervene militarily in another State’s territory without the permission of the Government of that State to halt or prevent it from committing atrocities against its own people? What about intervention where the territorial Government is unable or unwilling to provide basic humanitarian assistance to its people in the face of natural or human-made disaster?