Can co-op communities establish over-30 or child-free buildings?

I know that federal housing discrimination laws prevent age discrimination and family status discrimination for most housing matters -- such as home buying, apartment rental, etc. But in a co-op building, where you don't really own any real estate but only a share of the co-op corporation, would it be legal for the co-op to decide to allow only residents over 30 years old, or only people without children?


Answer:
I know of apartment complexes that are child free in my state of Indiana and in Ohio.
The co-op itself would be subject to the Fair Housing Act, and would be limited by its terms.