You're leaving about 99% of it out, as noted in the post you are responding to. Western interests in wanting Mossadeq gone and having reason to stop his attempt to overthrow the system of government doesn't negate Mossadeq's actions.
If the Shah had the authority to dismiss the Prime Minister, then why was there a need for a CIA - MI6 orchestrated coup?