The Home Owners' Association spells out the rules when you buy the house.
I was looking at a co-op this weekend and the real estate agent gave me the list of rules I'd be subject to if I bought the place. I was also made aware I have to go before the owners' board.