إِنَّمَا وَلِيُّكُمُ اللَّهُ وَرَسُولُهُ وَالَّذِينَ آمَنُوا الَّذِينَ يُقِيمُونَ الصَّلَاةَ وَيُؤْتُونَ الزَّكَاةَ وَهُمْ رَاكِعُونَ
Only Allah is your Vali and His Messenger and those who believe, those who keep up prayers and pay the poor-rate while they bow. (5:55) - Shakir
Excerpt from Tafseer of Agha Mahdi Pooya1:
All the commentators unanimously hold, as Qushaji admits in the Sharh al Tajrid on the subject of imamat, that this verse refers to Ali when he gave his ring to a beggar while bowing down in the course of his prayers.
When Abi Ishaq Ahmad ibn Muhammad ibn Ibrahim Naysaburi al Tha’labi reached this verse he recorded the following in his Tafseer al Kabir on the authority of Abu Dharrr al Ghifari, who said, "Both of my ears may turn deaf and both my eyes may become blind if I speak a lie. I heard the Holy Prophet saying, 'Ali is the guide of the righteous and the slayer of the infidels. He who has helped him is victorious and he who has abandoned him is forsaken.' One day I said my prayers in the company of the Holy Prophet; a beggar came to the masjid and begged for alms, but nobody gave him anything. Ali was in a state of ruku in the prayer. He pointed out his ring to the beggar, who approached him and removed the ring from his finger.
Thereupon the Holy Prophet implored Allah, saying: 'O Allah! My brother Musa begged You saying: My Lord, delight my heart and make my task easy and undo the knot in my tongue so that they may understand me, and appoint from among my kinsmen, Harun, my brother, as my vizier, and strengthen my back with him and make him participate in my mission so that we may glorify You and remember You more frequently. Certainly You see us-and You inspired him: O Musa! All your requests have been granted. (The Holy Prophet continued) Delight my heart and make my task easy and appoint from among my kinsmen Ali as my vizier and strengthen my back with him'. (Abu Dharr proceeds) By Allah, the Holy Prophet had not yet finished his supplication when the trustworthy Jibril descended to him with this verse." (Ibn Khallikan says that Al Tha’labi was unique as a commentator of the Qur’an and his Tafseer al Kabir is superior to all other Tafseers.)
In this verse the word wali has been used in the meaning of guardian or master or who holds authority superior to others. Please refer to the origin of the word wali in Sihah or Mukhtar al Sihah or any other good dictionary. The lexicographers have explained that he who manages the affairs of and exercises authority for another person is the wali of that person. This verse, therefore, means that those who manage the affairs of the people (mankind) are superior to all men, and certainly they are Allah, His messenger, the Holy Prophet, and Ali, who possesses all the qualifications enumerated in this verse. Allah has simultaneously confirmed His wilayah (superior authority), that of His prophet and his wali (Ali) in unbroken succession. Allah's wilayah is universal, so likewise, the wilayah of the Holy Prophet and his wali (Ali) must be so.
The word innama makes the decision of Allah (that He, the Holy Prophet and Ali alone are the masters of the believers) final and decisive. The construction of the sentence and the word wali, used in singular for all the three, means that wilayah of all the three is essentially one in nature as well as in effect. Therefore, obedience to the Holy Prophet must be as it should be to Allah, and obedience to Ali and his successors (the Imams among the Ahl ul-Bayt) must be as it should be to the Holy Prophet.