-
Notifications
You must be signed in to change notification settings - Fork 228
/
Copy pathfirestore.rules
29 lines (24 loc) · 992 Bytes
/
firestore.rules
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
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{uid} {
// Allow read access to all users
allow read: if true;
// Allow write access only if the user is authenticated and is writing to their own document
allow write: if request.auth != null && request.auth.uid == uid;
}
match /chatSessions/{id} {
allow read: if true;
// Allow write access if the user is authenticated and the document's userId matches the authenticated user's ID
allow write: if request.auth != null && request.resource.data.userId == request.auth.uid;
}
match /toolSessions/{id} {
allow read: if true;
// Allow write access if the user is authenticated and the document's userId matches the authenticated user's ID
allow write: if request.auth != null && request.resource.data.userId == request.auth.uid;
}
match /tools/{id} {
allow read: if true;
}
}
}