Sexual consent plays an important role in laws regarding rape, sexual assault and other forms of sexual violence. In a court of law, whether or not the alleged victim had freely given consent, and whether or not they were deemed to be capable of giving consent, can determine whether the alleged perpetrator is guilty of rape, sexual assault or some other form of sexual misconduct.
Although many jurisdictions do not define what sexual consent is, almost all jurisdictions in the world have determined an age of consent before which children are deemed incapable of consenting to sexual activity; engaging in sex with them thus constitutes statutory rape (see laws regarding child sexual abuse). Many also stipulate conditions under which adults are deemed incapable of consenting, such as being asleep or unconscious, intoxicated by alcohol or another drug, mentally or physically disabled, or deceived as to the nature of the act or the identity of the alleged perpetrator (rape by deception). Most disagreement is on whether rape legislation for otherwise healthy adults capable of consent should be based on them not having given consent to having sex, or based on them being forced through violence or threats to have sex. Some legislation determines that, as long as no coercion is used against them, people capable of consenting always automatically consent to sex (implied consent), whereas other laws stipulate that giving or withholding consent is something which only capable individuals can do on their own volition (freely given or affirmative consent). The 2000s and 2010s have seen a shift in favour of consent-based legislation, which was increasingly considered as providing better guarantees for the legal protection of (potential) victims of sexual violence.