-
Notifications
You must be signed in to change notification settings - Fork 24
/
firestore.rules
56 lines (56 loc) · 1.73 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /profiles/{userId} {
allow read: if request.auth != null && request.auth.uid == userId;
allow write: if false;
}
match /tokens/{userId} {
allow read: if request.auth != null && request.auth.uid == userId;
allow write: if false;
}
match /streamlabs/{userId} {
allow read: if request.auth != null && request.auth.uid == userId;
allow write: if false;
}
match /streamelements/{userId} {
allow read: if request.auth != null && request.auth.uid == userId;
allow write: if false;
}
match /realtimecash/{userId} {
allow read: if request.auth != null && request.auth.uid == userId;
allow write: if false;
}
match /actions/{document=**} {
allow read: if false;
allow create: if request.auth != null && request.resource.data.userId == request.auth.uid;
allow update: if false;
}
match /messages/{document=**} {
allow read: if true;
allow write: if false;
}
match /channels/{document=**} {
allow read: if true;
allow write: if false;
}
match /channels/{channelId}/messages/{document=**} {
allow read: if true;
allow write: if false;
}
match /chat-status/{document=**} {
allow list: if request.query.limit == 1;
allow get: if true;
allow write: if false;
}
match /metadata/{document=**} {
allow read: if resource.data.lastActiveAt.toMillis() >= request.time.toMillis() - 7 * 86400 * 1000;
allow write: if false;
}
match /companion-tokens/{document=**} {
allow get: if true;
allow list: if false;
allow write: if false;
}
}
}