Exercise 1: The Default-Deny Rule and Chapter 5's Error — Possible Solution ==================================================================== WHY `allow write: if false` WAS THE CORRECT STARTING RULE ------------------------------ Per this chapter, Chapter 1 set up Firestore in production mode, which denies every read and write by default until Security Rules explicitly grant permission. The `allow read, write: if false;` rule shown at the start of this chapter is exactly that default-deny state made explicit and visible - it isn't a mistake to fix immediately, it's the deliberately secure starting point every real Firestore project begins from, before anyone has decided what should actually be allowed. THE CONNECTION TO CHAPTER 5'S PERMISSION ERROR ------------------------------ Chapter 5 warned that its own addDoc call would fail with a permission-denied error because no rules yet existed to allow it - that failure was this exact `if false` rule doing precisely what it's supposed to do: rejecting a write with no explicit permission granted. The error wasn't a bug in Chapter 5's code; it was this default-deny rule correctly blocking a write it had no reason yet to allow. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly explains that the default-deny rule is the deliberate, secure starting state of a production-mode Firestore project, and correctly ties Chapter 5's own permission-denied error directly to that same rule doing exactly what it was designed to do at that point in the course.