Are you legally allowed to edit your own homes wiring?

Chagrin:
In the US the National Electric Code disallows an individual to adjust mains wiring unless they are a licensed electrician. I'm not sure how strict that rule is, e.g. if it disallows replacing a light fixture or such, but y'know.

The NEC is not a governmental organization with no regulatory powers, it's an industrial organization that publishes standards and recommendation. Typically local city or counties have the authority in this subject with their local building codes and often do stipulate NEC recommended practices. Also one's home insurance may most likely have wording about owner modified or new wiring and not cover fires if the result of owner actions.