Was Muhammad a lawmaker besides God?

Those who follow the messenger, the ummi prophet (Muhammad) whom they find written down in the
Torah and the Injeel
that are with them. He advocates righteousness to them and forbids them from evil. He
makes lawful for them the
good things and prohibits for them what is bad, and he relieves them
from the heavy burden and the shackles that were upon them.
7:157

Traditional Muslim preachers claim that prophet Muhammad was a lawmaker in his own right, with the authority to authorise good things and prohibit bad things. They cite the above verse in support of their claim.

It can be shown that this interpretation of 7:157 is inaccurate and is intended to proclaim prophet Muhammad as a lawmaker in his own right besides God!

If we study 7:157 in isolation, it may well seem that the prophet is spoken of as a lawmaker, however, if we study all the related verses together, the picture becomes totally different.

To study 7:157 we must also study 6:114 and 66:1.

Shall I seek other than God as a lawmaker when it is He who has brought down to you the Book fully detailed? 6:114

The message in 6:114 clearly stands out; God is the only lawmaker. Thus any messenger of God can only prohibit what is prohibited in the Book of God, and make lawful what God made lawful. The only duty of the messenger of God is to deliver God's message, but not to be a lawmaker besides God:

The sole duty of the messenger is the delivery (of God's message), and God knows what you reveal and what you conceal. 5:99

In addition, in 66:1 we read how God reprimanded prophet Muhammad for once prohibiting an item that was not prohibited by God.

O you prophet, why do you prohibit what God has made lawful for you, seeking to please your wives? God is Forgiver, Merciful. 66:1

This verse in particular makes this issue beyond dispute for all who take God's words in the Quran seriously: the prophet does not have the authority to prohibit except what is prohibited by God.

Following from the verses above (6:114, 5:99, 66:1), which all confirm that God is the only lawmaker, we also have confirmation in Sura 10 that God alone has to authority to decree what is halal (lawful) and what is haram (prohibited):

Say, "Have you seen what God has brought down to you of provisions, of which you have made some unlawful and some lawful?" Say, "Did God give you permission, or are you fabricating lies about God?" 10:59

The significance of the words "Did God give you permission" (for what is lawful and what is unlawful) cannot be ignored. The only name mentioned in connection with granting permission for what is lawful and what is not lawful is the name of God.

We conclude from the above verses the correct meaning of 7:157. Any messenger of God can only invite his people to do righteous acts, instructs them away from evil and prohibits them from bad things, all in accordance with God's law and God's Book.