I didn’t say anything about it being illegal. That’s just the standard sexual harassment policies that most corporations have.
I worked for a company that simply required full disclosure by both parties of any sexual relationship. Failure to disclose was grounds for termination, but the relationship itself was not necessarily cause for dismissal or even transfer.