The correct answer is: self-serving bias.
A person who shows a self-serving bias is one who wishes to maintain their good opinion of themselves, even boost their self-esteem, by interpreting situations in a biased manner. In a successful situation, they try to take all the glory for themselves while, in the case of failure, they refuse to take any portion of the blame or responsibility.