When you buy a condominium or home in a planned community with a homeowners association, you will be required to join it and pay it a fee that goes toward the maintenance of commonly held areas and services for the common good. In some cases, that might mean the HOA pays for the landscaping, the 24-hour security patrols and guard gates or maintaining the swimming pool and community clubhouse.

But HOAs also have policies designed to protect residents’ common welfare that sometimes seem to overstep boundaries. So if you’re buying a home covered by an HOA, you need to first read the CC&Rs, the declaration of covenants, conditions and restrictions, before you sign. It’s the body of regulations all the association’s homeowners are subject to, and it covers a wide range of topics. Depending on your HOA:

1. You might not be able to have a dog.

Some HOAs limit the number of dogs per household or the size of pets you are allowed to have. Some HOA communities ban specific dog breeds. And you may be counting on fencing in your new yard to contain Fido, only to learn from the CC&Rs that the HOA doesn’t permit fences.

You had better believe that dogs are not permitted off leash, and you will be using pooper scooper bags religiously.

2. You may not be able to use your garage for storage.

Some HOAs insist that you garage your car overnight and forbid you to park it on the street, in your driveway or in a parking spot designated for guests. This is generally presented as a safety precaution. Cars left on the street might hamper the neighborhood patrol’s ability to see any untoward activity. The result, though, is that if you were expecting to use your garage to store seasonal stuff, you might not be able to.

3. You might be prohibited from having a party whenever you want.

Use of the community swimming pool and clubhouse by you and your guests will be outlined in the HOA rules. The hours or use of the facility will be determined, the minimum age for children using the pool will be set, and you can pretty much figure that you won’t be allowed to blast music or drink out of anything made of glass. In addition, you may need to reserve and pay an additional fee for the clubhouse if you are hosting more than a certain number of guests. You will likely see regulations about reserving pool chairs, playing games in the pool and whether you are permitted to take food.

You may be paying for the pool maintenance as part of your HOA dues, but it won’t be the same as having your own backyard pool where you can skinny-dip at midnight in the privacy of your fenced yard.

4. You may find you can’t paint your house a different color.

Some CC&Rs stipulate what colors you may paint your house or even your front door and window trim. The idea is that the HOA wants to ensure the neighborhood looks well maintained and harmonious, and having a purple house that stands out might be considered jarring.

Still, some associations go overboard and may try to enforce rules with the enthusiasm of a Marine drill sergeant. The CC&Rs can stipulate what color curtains or blinds you may have if they are visible from the street. They may also prohibit you from drying laundry outside on a clothesline or erecting a basketball hoop in the driveway. Many forbid you to park your RV or boat on your property. And it’ll be a big no-no if you try to install a swing set in the yard, move your garbage cans to the curb if it isn’t the night before pickup or drag your old sofa to the sidewalk with a sign that says “free” on it. Want to have a garage sale? It’ll happen only on a day the HOA says so.

5. You could be stopped from remodeling the way you want to.

You’ll likely have to submit an application (with fee) for a variance, get your neighbors’ permission and possibly go through a formal hearing if you want to do something like add a room to your house or in any way change the home’s footprint. You won’t just need to comply with local zoning rules but also get the HOA to sign off on your plans.

Many HOAs have something to say if you just want to switch out your mailbox for something more fun. So yes, it will weigh in on your remodeling plans.

6. You might be required to fork over even more money in special circumstances.

Homeowners associations require members to pay fees for common property maintenance. The fees range — often several hundred dollars per month and over $1,000 if they include things like maintaining a golf course, a swimming pool or pools and a fitness facility. So basically, it’s like paying rent on top of a mortgage.

But that’s not all of it. If your HOA board thinks the community roads need to be repaved or the clubhouse needs a major facelift, it can call for a special assessment to be levied on all homeowners. Typically, a board can raise assessments up to 20 percent a year and levy a special assessment without a vote of the HOA members for a capital improvement.

For a first-time homeowner or one on a tight budget, an unexpected hike in the HOA fee or a large assessment can make a home unaffordable.

So what happens if you violate your HOA’s CC&Rs? It can fine you, suspend your right to use the common facilities or file a lawsuit against you. And if you fall behind in your dues and assessments, the HOA can get a lien on your home, which could lead to a foreclosure.