You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a summary of the rules changes for the init prompt (#9217)
Example output:
```
✦ I've updated your firestore.rules file with the following rules:
1 rules_version = '2';
2
3 service cloud.firestore {
4 match /databases/{database}/documents {
5 // Notes are personal data, only accessible by the owner
6 match /notes/{noteId} {
7 allow read, write, delete: if request.auth != null && resource.data.userId == request.auth.uid;
8 }
9 match /notes/{noteId} {
10 allow create: if request.auth != null;
11 }
12 }
13 }
These rules enforce that:
* Only authenticated users can create notes.
* Users can only read, update, or delete their own notes.
Do you approve of these rules? If so, I'll deploy them.
```
Co-authored-by: Joe Hanley <[email protected]>
Copy file name to clipboardExpand all lines: src/mcp/resources/guides/init_firestore_rules.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ ${config.readProjectFile("firestore.rules", { fallback: "<FILE DOES NOT EXIST>"
27
27
1. Create the personalData and publicData security rules (seen below). If they have existing \`firestore.rules\`, integrate these with the user's existing rules.
28
28
2. Validate & fix the security rules using the \`validate_rules\` tool. Only continue to the next step when the \`validate_rules\` tool succeeds
29
29
3. Update queries in the user's app to use the updated security rules
30
-
4. Print the contents of the \`firestore.rules\` file. Ask the user for permission to deploy the rules. Do not continue until the user confirms. Deploy the security rules using \`firebase deploy --only firestore\` in the terminal. Do not tell the user to go to the console to deploy rules as this command will do it automatically.
30
+
4. Print the contents of the \`firestore.rules\` file, and then explain what they enforce below them (for example, what changes you've made to the rules, and what actions are allowed / prohibited on each entity). Ask the user for permission to deploy the rules. Do not continue until the user confirms. Deploy the security rules using \`firebase deploy --only firestore\` in the terminal. Do not tell the user to go to the console to deploy rules as this command will do it automatically.
31
31
32
32
For database entities that neatly fall into the "personal" and "public categories, you can use the personalData and publicData rules. Use the following firestore.rules file, and add a comment above 'personalData' and 'publicData' to note what entities apply to each rule.
0 commit comments