-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdatabase.rules.json
More file actions
49 lines (49 loc) · 2.43 KB
/
Copy pathdatabase.rules.json
File metadata and controls
49 lines (49 loc) · 2.43 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
{
"rules": {
"admins": {
"$uid": {
".read": "auth != null && (auth.uid === $uid || root.child('admins').child(auth.uid).val() === true)",
".write": "auth != null && (root.child('admins').child(auth.uid).val() === true || (auth.uid === $uid && !root.child('admins').exists() && newData.val() === true))"
}
},
"workshopHosts": {
"$uid": {
".read": "auth != null && (auth.uid === $uid || root.child('admins').child(auth.uid).val() === true)",
".write": "auth != null && root.child('admins').child(auth.uid).val() === true"
}
},
"hostRooms": {
"$uid": {
".read": "auth != null && auth.uid === $uid",
".write": "auth != null && auth.uid === $uid && (root.child('admins').child(auth.uid).val() === true || root.child('workshopHosts').child(auth.uid).val() === true)"
}
},
"rooms": {
"$code": {
"meta": {
".read": "auth != null",
".write": "auth != null && (root.child('admins').child(auth.uid).val() === true || root.child('workshopHosts').child(auth.uid).val() === true) && (!data.exists() || data.child('createdBy').val() === auth.uid)",
".validate": "newData.hasChildren(['status', 'createdBy', 'createdAt']) && newData.child('status').val().matches(/^(open|closed)$/) && newData.child('createdBy').isString() && (!newData.hasChild('title') || (newData.child('title').isString() && newData.child('title').val().length > 0 && newData.child('title').val().length <= 80))"
},
"participants": {
".read": "auth != null && (root.child('admins').child(auth.uid).val() === true || root.child('workshopHosts').child(auth.uid).val() === true) && root.child('rooms').child($code).child('meta').child('createdBy').val() === auth.uid",
"$uid": {
".read": "auth != null && auth.uid === $uid",
".write": "auth != null && auth.uid === $uid && root.child('rooms').child($code).child('meta').child('status').val() === 'open'"
}
}
}
},
"stats": {
".read": "auth != null"
},
"completions": {
".read": "auth != null && root.child('admins').child(auth.uid).val() === true",
".indexOn": ["email", "district", "webhookStatus", "submittedAt"],
"$uid": {
".read": "auth != null && auth.uid === $uid",
".write": "auth != null && auth.uid === $uid && (!data.exists() || !data.hasChild('submittedAt'))"
}
}
}
}