-
Notifications
You must be signed in to change notification settings - Fork 0
/
db.rules.json
62 lines (62 loc) · 2.28 KB
/
db.rules.json
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
{
"rules": {
"games": {
".read": "auth !== null && root.child('users').child(auth.uid).child('verified').val() === true",
"$game": {
".write": "auth !== null && root.child('users').child(auth.uid).child('verified').val() === true",
".validate": "newData.hasChild('gid')",
"gid": {
".validate": "$game === newData.val()"
}
}
},
"users": {
".read": "auth !== null && root.child('users').child(auth.uid).child('verified').val() === true",
"$user_id": {
".read": "auth !== null && auth.uid === $user_id",
"name": {
".write": "auth !== null && auth.uid === $user_id",
".validate": "newData.isString() && newData.val().length >= 2 && newData.val().length <= 12"
}
}
},
"messaging": {
"$user_id": {
".read": "auth !== null && auth.uid === $user_id && root.child('users').child(auth.uid).child('verified').val() === true",
".write": "auth !== null && auth.uid === $user_id && root.child('users').child(auth.uid).child('verified').val() === true"
}
},
"events": {
".read": "auth !== null && root.child('users').child(auth.uid).child('verified').val() === true",
"$event": {
".write": "auth !== null && root.child('users').child(auth.uid).child('verified').val() === true && (data.child('creator').val() === auth.uid || newData.child('creator').val() === auth.uid)",
".validate": "newData.hasChildren(['id','creator'])",
"id": {
".validate": "$event === newData.val()"
},
"creator": {
".validate": "!data.exists()"
},
"lastVoted": {
"$voter": {
".write": "auth !== null && root.child('users').child(auth.uid).child('verified').val() === true && $voter === auth.uid"
}
},
"days": {
"$day": {
"$time": {
"votes": {
"$voter": {
".write": "auth !== null && root.child('users').child(auth.uid).child('verified').val() === true && $voter === auth.uid"
}
}
}
}
}
}
},
"calendar": {
".read": "auth !== null && root.child('users').child(auth.uid).child('verified').val() === true"
}
}
}