The president of the Human Rights Campaign described the law as allowing ‘government-sanctioned harassment’