Final answer:
The Electronic Communications Privacy Act (ECPA) allowed the government access to private electronic messages such as emails and social media posts.
Step-by-step explanation:
The law that allowed the government access to private electronic messages such as emails and social media posts is the Electronic Communications Privacy Act (ECPA). The ECPA was passed in 1986 and regulates the interception and disclosure of wire, oral, and electronic communications.