Consequentialism is the philosophy that an action is considered to be ethical if it enhances the collective happiness of those impacted by it. Thus, an action could be considered ethical even if it does not follow the law, as long as the marginal benefits to society of the decision exceed its marginal costs. In essence, any action that achieves the greatest good for the largest number of people is considered to be ethical. A side benefit of consequentialism is that it forces the decision maker to quantify the pluses and minuses of each decision made, though quantifying pros and cons is not always easy. However, the concept can be taken too far, since this ethical framework essentially allows that the ends justify the means, even if the means used are troubling.
For example, A city government decides to expand the hours during which a local park will be kept open each day. Doing so harms the privacy of 20 local homeowners, but improves park access for approximately 500 people who would otherwise be unable to access the park during their normal working hours. Under consequentialism, this action is good, because the proportion of people helped by it greatly exceeds the number who are harmed.