An HOA rule mandated that only tenants – no guests – could use the pool, and it shut down the entire pool for a day after someone broke that rule. Is that legal?

An HOA rule mandated that only tenants – no guests – could use the pool, and it shut down the entire pool for a day after someone broke that rule. Is that legal?