Was in Oregon and my inspector said it’s sadly legal and very common to have restrictions like that.
Last I heard they were being sued over that community at least.