-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirebase-rules.txt
More file actions
30 lines (27 loc) · 1.12 KB
/
firebase-rules.txt
File metadata and controls
30 lines (27 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Recommended Firestore security rules for GoAgents application
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Allow users to read and write only their own data
match /Users/{userId} {
// Allow authenticated users to read and write their own documents
allow read, write: if request.auth != null && request.auth.uid == userId;
// Also allow unauthenticated create for signup process
allow create: if request.resource.data.email != null;
}
// Allow writes to the leads collection from the server
match /leads/{document=**} {
// Allow all operations on leads collection
// This is safe because only the server can access this endpoint
allow read, write: if true;
}
}
}
// IMPORTANT: These rules allow the signup process to work with the client SDK.
// For production, you may want to adjust them to be more restrictive.
// Upload these rules in the Firebase Console:
// 1. Go to https://console.firebase.google.com/
// 2. Select your project
// 3. Go to Firestore Database > Rules
// 4. Paste these rules
// 5. Click Publish