Here are two ego shields:
'Resentment is problematic but anger is fine, because it protects me against people breaching my boundaries.'
This is based on a principle that is fundamentally good, but the principle is to be used sparingly. It's a micronutrient not a food group.
The first time one encounters someone behaving badly in a particular way, it can be a little bit of a surprise, and there is rightly a flash of anger. One has usually misjudged the situation and failed to appreciate the risk. Once this flash of anger has passed, people then divide into two camps: the well-adjusted understand what has happened, now rightly expect the behaviour to recur in some form or another, adapt (like the Borg in Star Trek), cease to reignite their anger each time it does recur, and formulate an appropriate practical response. The anger is necessary once to alert one to the 'misbehaviour'. Once the 'misbehaviour' is known, anger's job is done. Wits and wisdom then relieve anger at the sentry post.
By contrast, when one responds with anger a second or subsequent time to the same phenomenon, the anger is serving no purpose. It ceases to be a sign that an external phenomenon has occurred and instead becomes a sign that the angered person has not undertaken the adjustment process.
One thing I've noticed over the years is that one has to be frightfully careful with people who justify anger. They seem to be angry about rather a lot, rather a lot of the time, and, soon enough, they'll be angry with you.
'When I get angry, I have to be kind to myself and not beat myself up for it.'
This, too, has an element of truth to it. Self-reproach is a poor substitute for self-examination, but this principle is taken to an extreme, and the avoidance of self-reproach becomes an avoidance of responsibility for one's own emotions and experience of life. Those who refuse to 'beat themselves up' are sometimes quick to beat others up, cf. the above point regarding the breaching of boundaries; for every boundary that is breached, there is a bony finger of accusation pointing outwards.
The proof of the pudding is in the eating, and very often the above two principles, when espoused, are accompanied by a statement to the effect, 'And recently I've been having a very hard time.' It turns out that the ego can operate very well behind these two shield, and it is the ego that is producing the very hard time.