The Messenger of Allah (s.a.w.a.) informed: When Allah created the heavens and the earth, He called on them and they responded. He presented my Prophethood and the Wilayat (unconditional, unlimited authority) of Ali b. Abi Talib to them, both of which they accepted. Then Allah created the creatures and entrusted the religious affairs to us. Therefore, the happy ones are those who are happy with us, and the unhappy are those who are unhappy with us. We permit that which Allah has made lawful and prohibit that which Allah has deemed unlawful.
Maqtal al-Husain v 1 p 46 Ghaayah al-Maraam p 208 Behaar al-Anwaar v 17 p 13