-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirestore.rules
23 lines (23 loc) · 901 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
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /usage/{anyDocument} {
allow read: if request.auth != null && (request.auth.uid == resource.data.userId || !exists(request.path))
}
match /countries/{anyDocument} {
allow read: if request.auth != null && (request.auth.uid == resource.data.userId || !exists(request.path))
}
match /hosts/{anyDocument} {
allow read: if request.auth != null && (request.auth.uid == resource.data.userId || !exists(request.path))
}
match /hostToCountry/{anyDocument} {
allow read: if request.auth != null && (request.auth.uid == resource.data.userId || !exists(request.path))
}
match /users/{userId}/{documents=**} {
allow read: if request.auth != null && request.auth.uid == userId
}
match /{document=**} {
allow read, write: if false;
}
}
}