
123 Ariz. 72 (1979)
597 P.2d 554
STATE of Arizona, Appellee,
v.
Gregory JENSON, Appellant.
Nos. 1 CA-CR 3343, 1 CA-CR 3345.
Court of Appeals of Arizona, Division 1, Department A.
May 15, 1979.
Rehearing Denied June 18, 1979.
Review Denied July 10, 1979.
*73 John A. LaSota, Jr., Atty. Gen. by Georgia B. Ellexson, Asst. Atty. Gen., Phoenix, for appellee.
Ross P. Lee, Maricopa County Public Defender by Joel M. Glynn, Deputy Public Defender, Phoenix, for appellant.
OPINION
HAIRE, Judge.
On this appeal from the revocation of his probation, defendant contends that A.R.S. § 36-1002.02E (Laws 1976, Ch. 111, § 12) is unconstitutional because it violates the due process principles established by the United States Supreme Court in Gagnon v. Scarpelli, 411 U.S. 788, 93 S.Ct. 1756, 36 L.Ed.2d 656 (1973).
The defendant had previously been convicted of two separate charges involving the sale of heroin in violation of A.R.S. §§ 36-1001 and 36-1002.02. He was placed on probation on both charges. Subsequently he was found to have violated the conditions of his probation by failing to report as required to his probation officer. His probation sentences were not revoked as a result of that violation, but rather probation was reinstated in both cases.
Thereafter, a petition was again filed in both cases, alleging, among other violations, a violation by defendant of Term No. 16[1] of the conditions of probation in that the defendant "used a narcotic substance on or about December 20, 1977."
Term No. 6 of the probationary terms required that the defendant submit to urinalysis testing as directed by his probation officer. At the violation hearing evidence was presented that defendant had submitted a urine sample that upon urinalysis testing revealed the presence of morphine. In addition, the defendant's probation officer testified that the defendant had admitted to him that he had used heroin at that time.
The provisions of A.R.S. § 36-1002.02E (Laws 1976, Ch. 111, § 12) pertinent to the issues raised on appeal read as follows:
"E. Any person placed on probation under this section who, as a condition of probation, is required to submit to a periodic urinalysis screening and who fails such urinalysis screening shall have such probation immediately revoked upon a hearing by the court provided that such probation shall not be revoked if the failure of the urinalysis screening is due solely to the influence of medication prescribed by a physician or to participating in an approved methadone maintenance program."
It is clear from the sentencing transcript that the trial judge regarded the above provision as removing any discretion he might otherwise have had to determine whether defendant's probation should, or should not, be revoked.[2] The defendant, *74 relying upon Gagnon, supra, contends that this statutory requirement of automatic revocation improperly restricts the discretion of the trial judge in probation revocation proceedings, thus resulting in a due process violation which renders the statute unconstitutional. He argues that Gagnon mandates that in all cases, after the initial evidentiary hearing is held to determine whether a defendant has in fact violated a condition of probation, there must be a second hearing at which evidence may be offered, and a discretionary decision be made by the trial judge as to whether the defendant's probation should be revoked. We disagree.
Arizona has, of course, recognized and given effect to the due process principles promulgated in Gagnon and has established, by case law and court rule, procedures designed to assure due process in probation revocation matters. See, e.g., State v. Settle, 20 Ariz. App. 283, 512 P.2d 46 (1973); Rule 27, Rules of Criminal Procedure, 17 A.R.S. The narrower issue in this appeal, however, concerns due process standards for the exercise of sentencing discretion; and in our opinion the requirements of Gagnon must be interpreted as governing in this area only when, under the applicable statutory scheme, the judge is vested with such discretion.
The power of a court to grant probation is not inherent, but rather is derived from statute, and probation may only be granted in accordance with the statutory authorization. State v. Carter, 116 Ariz. 595, 570 P.2d 763 (1977); State v. Pakula, 113 Ariz. 122, 547 P.2d 476 (1976); State v. Blackman, 114 Ariz. 517, 562 P.2d 397 (App. 1977); State v. Pitts, 26 Ariz. App. 390, 548 P.2d 1202 (1976). A trial judge has no discretion to impose any sentence other than that specified by statute. State v. Tyree, 109 Ariz. 259, 508 P.2d 335 (1973). There is no discretion to substitute the trial judge's own judgment for a penalty prescribed by the legislature. State v. Hays, 109 Ariz. 123, 506 P.2d 254 (1973). Several decisions have recognized and upheld the validity of the Arizona legislature's policy decision to treat certain narcotics violations with strong penalties. See, e.g., State v. O'Donnal, 110 Ariz. 552, 521 P.2d 984 (1974); State v. Hays, supra.
Statutes that prohibit altogether the granting of probation upon conviction of a specified crime have been upheld against constitutional attack. See Gallego v. United States, 276 F.2d 914 (9th Cir.1960); State v. Freeman, 223 Kan. 362, 574 P.2d 950 (1978). If the state may entirely preclude the granting of probation upon conviction of a specified crime, we see no reason why it should be precluded from enacting a more lenient statute that extends greater rights to a defendant by initially allowing the imposition of probation, but making revocation thereof mandatory upon the violation of certain statutorily specified conditions. In summary, we find no basis in Gagnon for defendant's contention that he has a constitutionally protected due process right to a statutory scheme that in all instances vests discretion in the trial judge to decide whether probation should, or should not be, revoked, regardless of the nature of the violation.
Defendant also contends that A.R.S. § 36-1002.02E violates due process because it allegedly deprives him of the normal criminal defenses allowed by A.R.S. § 13-134.[3] Defendant's argument in this regard *75 is based upon the language of § 36-1002.02E that provides that "... such probation shall not be revoked if the failure of the urinalysis screening is due solely to the influence of medication prescribed by a physician or to participating in an approved methadone maintenance program." (Emphasis added). Defendant reads "solely" as prohibiting any other defense. In our opinion, a more reasonable interpretation of the statutory language is that the legislature merely intended to make it clear that a violation of this harsh statutory provision could not be based solely on the influence of medicine or participation in an approved methadone maintenance program. We find no intent to deprive a defendant of the fundamental defenses specified in A.R.S. § 13-134. Lest there be some misunderstanding, we hasten to add that here there is no contention that defendant was, in fact, denied the opportunity to present any defenses he might have had.
The judgments and sentences are affirmed.
DONOFRIO and FROEB, JJ., concur.
NOTES
[1]  Term No. 16 required that the defendant should "[n]ot possess or use any narcotics including marijuana, heroin or dangerous drugs in violation of any law."
[2]  The trial judge stated:

"I regard the statute as being mandatory and a legislative determination by the Arizona Legislature that when someone has been convicted of sale of a narcotic drug and he is required as a term of probation to submit urine specimens and those urine specimens or specimen indicate that the defendant has used morphine derivatives, that the probation must be revoked and the defendant must be sentenced to the Arizona State Prison and incur the mandatory minimum sentence under the statute."
[3]  A.R.S. § 13-134 (as amended 1973) reads as follows:

"The following persons shall not be punished for their acts or omissions:
"1. Those who committed the act or made the omission charged under an ignorance or mistake of fact, which disproves any criminal intent.
"2. Those who committed the act charged without being conscious thereof.
"3. Those who committed the act or made the omission charged through misfortune or by accident, when it appears that there was no evil design, intention or culpable negligence.
"4. Married persons, except for felonies, acting under threats, command or coercion of their spouses.
"5. Those, unless the crime is punishable with death, who committed the act or made the omission charged under threats or menaces sufficient to show that they had reasonable cause to, and did believe their lives would be endangered if they refused."
