-
Notifications
You must be signed in to change notification settings - Fork 0
/
firestore.rules
35 lines (34 loc) · 1.08 KB
/
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
30
31
32
33
34
35
rules_version = "2";
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if false;
}
match /roomDetail/{id} {
allow read, write: if true;
}
match /roomDetail/{id}/messages/{messageId} {
allow read, write: if true;
}
match /games/{id} {
allow read, write: if true;
}
match /queue/{id} {
allow read, write: if true;
}
match /users/{uid} {
allow write: if request.resource.data.keys().hasOnly(['email', 'givenname', 'familyname', 'profilePic', 'userRooms']) ||
request.resource.data.firstName is string
&& request.resource.data.lastName is string
&& request.auth.uid == uid ||
request.resource.data.pushTokenWeb is string
&& request.auth.uid == uid;
allow update: if request.resource.data.firstName is string
&& request.resource.data.lastName is string
&& request.auth.uid == uid ||
request.resource.data.pushTokenWeb is string
&& request.auth.uid == uid;
allow read: if request.auth.uid == uid;
}
}
}