The legality of the UN Security Council Resolution 1696 demanding that Iran give up its right to use nuclear technology is highly questionable and is ultra vires.
(NOTE: This post has been updated)
The claim: UNSC Resolutions Trump the NonProliferation Treaty
Article IV of the Non-Proliferation Treaty (NPT) recognizes (does not "grant" - recognizes) the "inalienable right" of signatories such as Iran to have access to nuclear technology "to the fullest extent possible" and "without discrimination".
Those who claim that Iran must give in to the UNSC demands under Resolution 1696 point to Article 103 of the UN Charter to claim that the UNSC resolutions take precedence over the NPT:
In the event of a conflict between the obligations of the Members of the United Nations under the present Charter and their obligations under any other international agreement, their obligations under the present Charter shall prevail.
They claim that since Iran's rights under the NPT conflict with the UNSC resolutions, then according to Article 103, the UNSC resolutions trump the NPT.
The Error: Iran's nuclear rights are not solely Treaty-based
The error in the above argument is to assume that the conflict over Iran is simply about the NPT versus the UNSC. That's not true, and Article 103 does not even apply to this case.
Why? Note that Article 103 applies to conflicts betwee 'agreements' (treaties) and UNSC resolutions. Iran's right to have nuclear technology does not arise from any agreement or treaty - rather Iran's right to nuclear technology is a sovereign right which is independent of the NPT. The NPT simply recognizes Iran's pre-existing sovereign right to nuclear technology - it does not grant Iran this right. Under the NPT, Iran agreed to simply suspend and limit some of those rights (by promising not to build nukes and by allowing IAEA inspections, in return for some promises from the Nuclear-armed states.) However, if Iran ever theoretically decided to pull out of the NPT (as the NPT permits) then Iran would have be free to exercise her full nuclear rights.
Nuclear Power is a Sovereign Right
The right to develop technology of any sort is a sovereign right of each state; it is not dependent on the NPT. That's why countries which haven't signed the NPT have the right to nuclear technology too - because they are sovereign nations.
India, Israel, Pakistan aren't violating any international laws by having nuclear technology even though they haven't signed the NPT. Similarly, Iran's "inalienable" right to access technology arises from the same fundamental principle of state sovereignty (known as "jus cogens" or peremptory norms of international law) that even the Security Council cannot trump.
UNSC Resolutions cannot trump Sovereign Rights
Those who argue that the UNSC resolution is "binding" forget that there are well-recognized limits to the UNSC's power.
When it comes to fundamental, overriding principles of international law (known as "jus cogens") the UNSC is not free to do as it wishes. When a UNSC resolution conflicts with a principle of jus cogens, the resolution is not binding.
Regarding limits on the UNSC, ICJ Judge Sir Gerald Fitzmaurice has been quoted to say:
The Security Council, even when acting genuinely for the preservation or restoration of peace and security, has a scope of action limited by the State's sovereignty and the fundamental rights without which that sovereignty cannot be exercised.
And as ICJ Judge Lauterpacht has written:
"The relief which Article 103 of the Charter may give the Security Council in case of conflict between one of its decisions and an operative treaty obligations cannot - as a simple hierarchy of norms - extend to a conflict between a Security Counsel resolutions and jus cogens"
And what are some examples of these fundamental, overriding preemptory laws? Some are listed in the "Purposes and Principles” section of the UN Charter (Articles 1 and 2): respect for equal rights and self-determination of peoples; sovereign equality of States; fulfilment in good faith of international obligations; settlement of international disputes by peaceful means; prohibition of the threat or use of force against other States in any manner inconsistent with the purposes of the UN. All of these principles ensure and protect a state's right to technological progess as a fundamental principle of international law, including Iran's right to nuclear technology.
Since Iran's right to technological progress and nuclear power is protected as a fundamental principle of sovereignty, and Article 103 is inapplicable. The UNSC resolutions against Iran, to the extent that they seeks to deprive Iran of her "inalienable right" to nuclear technological progress, are contrary to fundamental principles of international law and are therefore non-binding.
Note further that the Iranian file was brought to the UNSC in an illegal manner. Iran's safeguard agreement with the IAEA, and the IAEA statutes only permit a referral to the UNSC when there has been a diversion of fissile material for non-peaceful use. The IAEA has confirmed that there has been no such diversion, and that all declared fissile material in Iran has been accounted for. Thus, there is no basis for a referral of Iran's file to the UNSC and the decision to do so was ultra vires - but it happened anyway because of US pressure on the IAEA Board member nations (plus a juicy bribe to India in the form of nuclear cooperation - which was itself a violation of the Non-Proliferation Treaty)
I don't pretend to be a legal expert on such matters, but all this does raise (at least in my opinion) enough issues to doubt assertions that Iran is "legally obligated" to implement UNSC resolutions demanding that Iran give up its right to nuclear technology.
(NOTE: This post has been updated)