-
-
Notifications
You must be signed in to change notification settings - Fork 409
/
firestore.rules
105 lines (85 loc) · 2.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
function userIntegrationsRead() {
// User integrations may only be read if the data pertains to the authenticated user.
return request.auth.uid == resource.id
}
function userIntegrationsWrite() {
// User integrations may only be writen to if the updated resource pertains to the authenticated user.
return request.auth.uid == request.resource.id
}
function isPublicReadable() {
return true;
}
function isPublicWritable() {
return true;
}
function noWriteAccess() {
return false;
}
match /aggregations_rev20220126/{document=**} {
allow read: if isPublicReadable();
allow write: if isPublicWritable();
}
match /discussions_rev20231022/{document=**} {
allow read: if isPublicReadable();
allow write: if isPublicWritable();
}
match /emails/{document=**} {
allow read: if isPublicReadable();
allow write: if false;
}
match /question_categories_rev20231130/{document=**} {
allow read: if isPublicReadable();
allow write: if noWriteAccess();
}
match /questions_rev20230926/{document=**} {
allow read: if isPublicReadable();
allow write: if isPublicWritable();
}
match /research_categories_rev20221224/{document=**} {
allow read: if isPublicReadable();
allow write: if noWriteAccess();
}
match /research_rev20201020/{document=**} {
allow read: if isPublicReadable();
allow write: if isPublicWritable();
}
match /templates/{document=**} {
allow read: if false
allow write: if false
}
match /user_integrations/{document=**} {
allow get: if userIntegrationsRead()
// Do not allow users to list all user integrations.
allow list: if false
allow write: if userIntegrationsWrite()
}
match /user_notifications_rev20221209/{document=**} {
allow read: if isPublicReadable();
allow write: if isPublicWritable();
}
match /v3_howtos/{document=**} {
allow read: if isPublicReadable();
allow write: if isPublicWritable();
}
match /v3_mappins/{document=**} {
allow read: if isPublicReadable();
allow write: if isPublicWritable();
}
match /v3_categories/{document=**} {
allow read: if isPublicReadable();
allow write: if noWriteAccess();
}
match /v3_tags/{document=**} {
allow read: if isPublicReadable();
allow write: if noWriteAccess();
}
match /v3_users/{userId} {
allow read: if isPublicReadable();
allow write: if isPublicWritable();
allow delete: if request.auth != null && request.auth.uid == userId;
}
}
}