When and where this is appropriate is when this is done by professionals with a specific recovery plan. If you're a punter taking living material from an endangered species and thinking you're somehow helping, you're wrong. Ex situ conservation only works properly when approached with proper planning and background research. Inbred cultivated material is generally useless for conservation purposes. Having an endangered species in captivity without any plan of breeding it with other individuals and reintroducing the offspring back into the wild is a pointless pursuit that achieves nothing. As a biologist/ecologist, I can assure you that wild harvesting live material is rarely acceptable or ethical - this can include seed collection, depending on how it is done and the conservation status of the species. To add to that, collecting seed from a limited number of individuals and then cultivating those will always lead to a loss of genetic diversity, which itself is a threat to the conservation of endangered species.
I would ask everyone here to resist the urge to harvest any living material or seeds from any wild plants; it can be and often is incredibly damaging and a serious threat to the persistence of these species. We see what poaching does to the megafauna in Africa - poaching from Acacia obtusifolia or Acacia phlebophylla in Australia is no different. Be part of the solution, not part of the problem. If we care about these plants, then we have to protect them.