 Some see it forbidden in certain cases (i.e.if it leads a man/woman to ignore their spouse sexually) but recommended it when they see it as a lesser evil to illicit sex.It is generally prohibited according to the "Hanafi" and "Hanbali" "madhaahib", unless one fears adultery or fornication, or is under the desire pressure, in which case, it is permissible to seek a relief through masturbation.