-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfirebase_rules.json
More file actions
212 lines (210 loc) · 11.3 KB
/
firebase_rules.json
File metadata and controls
212 lines (210 loc) · 11.3 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
{
"rules": {
"bots": {
".indexOn": "owner"
},
"feedback": {".read": "true", ".write": "true"},
"reports": {".read": "true", ".write": "true"},
"users": {
"$uid": {
".write": "!data.exists() && auth !== null && auth.uid === $uid",
"$followerUid": {
".write": "auth !== null &&
auth.uid === $followerUid &&
newData.isString() && newData.val() === 'follow' &&
(!root.child('users').child(auth.uid).child('banned').exists() ||
root.child('users').child(auth.uid).child('banned').val() === false)",
".validate": "newData.isString() && newData.val() === 'follow'"
},
"username": {
".read": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)",
".write": "!data.exists() && newData.isString() && auth.uid === $uid && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)"
},
"bio": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false) && $uid === auth.uid)"
},
"pic": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false) && $uid === auth.uid)"
},
"email": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false) && $uid === auth.uid)"
},
"followers": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false))"
},
"fcmToken": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false) && $uid === auth.uid)"
},
"id": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false) && $uid === auth.uid)"
},
"name": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false) && $uid === auth.uid)"
},
"updated_at": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false) && $uid === auth.uid)"
},
"verify": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false) && $uid === auth.uid)"
},
"mod": {
".write": "false"
},
"contributor": {
".write": "false"
},
"team": {
".write": "false"
},
"challenges": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false) && $uid === auth.uid)"
},
"canEditProfileColor": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false))"
},
"verifyExpiry": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false))"
},
"stories": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false))"
},
"spentStreaks": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false))"
},
"streaks": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false))"
},
"private": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false))"
},
"profileTheme": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false))"
},
"profileThemeColor": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false))"
},
"hasProfileAnalytics": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false))"
},
"highlights": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false))"
},
"coverPhoto": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false))"
},
"canEditProfileBanner": {
".write": "(auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false))"
},
".read": "auth !== null && (!data.child('banned').exists() || data.child('banned').val() === false)",
},
".indexOn": "username",
".read": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)"
},
"chats": {
".read": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)",
".write": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)"
},
"challenges": {
".read": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)",
".write": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)"
},
"comments": {
".read": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)",
".write": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)"
},
"groups": {
".read": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)",
".write": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)"
},
"notifications": {
".read": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)",
".write": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)"
},
"reels_comments": {
".read": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)",
".write": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)"
},
"streaks_store": {
".read": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)",
".write": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)"
},
".read": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)",
"posts": {
"$post": {
"userActions": {
".write": "auth !== null &&
(!root.child('users').child(auth.uid).child('banned').exists() ||
root.child('users').child(auth.uid).child('banned').val() === false)",
},
"shares": {
".write": "auth !== null &&
(!root.child('users').child(auth.uid).child('banned').exists() ||
root.child('users').child(auth.uid).child('banned').val() === false)",
},
".read": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)",
".write": "auth !== null &&
root.child('users').child(auth.uid).child('banned').val() !== true &&
(
root.child('users').child(auth.uid).child('mod').val() === true ||
(
!data.exists() && newData.child('userEmail').val() === auth.uid
) ||
(
data.exists() && newData.exists() &&
data.child('userEmail').val() === auth.uid &&
newData.child('userEmail').val() === data.child('userEmail').val()
) ||
(
data.exists() && !newData.exists() &&
data.child('userEmail').val() === auth.uid
)
)"
},
".indexOn": "userEmail",
".read": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)",
},
"reels": {
"$post": {
"userActions": {
".write": "auth !== null &&
(!root.child('users').child(auth.uid).child('banned').exists() ||
root.child('users').child(auth.uid).child('banned').val() === false)",
},
"shares": {
".write": "auth !== null &&
(!root.child('users').child(auth.uid).child('banned').exists() ||
root.child('users').child(auth.uid).child('banned').val() === false)",
},
"watchTime": {
".write": "auth !== null &&
(!root.child('users').child(auth.uid).child('banned').exists() ||
root.child('users').child(auth.uid).child('banned').val() === false)",
},
"views": {
".write": "auth !== null &&
(!root.child('users').child(auth.uid).child('banned').exists() ||
root.child('users').child(auth.uid).child('banned').val() === false)",
},
".read": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)",
".write": "auth !== null &&
root.child('users').child(auth.uid).child('banned').val() !== true &&
(
root.child('users').child(auth.uid).child('mod').val() === true ||
(
!data.exists() && newData.child('uid').val() === auth.uid
) ||
(
data.exists() && newData.exists() &&
data.child('uid').val() === auth.uid &&
newData.child('uid').val() === data.child('uid').val()
) ||
(
data.exists() && !newData.exists() &&
data.child('uid').val() === auth.uid
)
)"
},
".read": "auth !== null && (!root.child('users').child(auth.uid).child('banned').exists() || root.child('users').child(auth.uid).child('banned').val() === false)",
}
}
}