Rules are explicitly for the ignorant. If you know what the right thing to do is but the rules say you can't, you have a moral responsibility to break the rules. If the rules say you can do something wrong, you still have the moral responsibility to refrain. If you believe that duty is a moral responsibility, you're one of the ignorant that the rules are for.
If being a good person isn't sufficient, rules are mere tyranny. I'm looking at you, online forums that require rule validation to proceed.