-
Notifications
You must be signed in to change notification settings - Fork 3
/
database.rules.json
84 lines (84 loc) · 4.66 KB
/
database.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
"rules": {
"games": {
"$gameid": {
"settings": {
".read": "root.child('games').child($gameid).child('settings').child('public').val() === true || root.child('games').child($gameid).child('settings').child('gameid').val() === root.child('users').child(auth.uid).child('gameid').val()",
".write": "auth != null"
},
"categories": {
".read": "auth != null && $gameid === root.child('users').child(auth.uid).child('gameid').val()",
".write": "root.child('games').child($gameid).child('members').child(auth.uid).child('admin').val() === true"
},
"matches": {
".indexOn": ["category", "matchstart"],
".read": "auth != null && $gameid === root.child('users').child(auth.uid).child('gameid').val()",
".write": "root.child('games').child($gameid).child('members').child(auth.uid).child('admin').val() === true"
},
"ranking": {
".read": "auth != null && $gameid === root.child('users').child(auth.uid).child('gameid').val()",
".write": "root.child('games').child($gameid).child('members').child(auth.uid).child('admin').val() === true"
},
"teams": {
".read": "auth != null && $gameid === root.child('users').child(auth.uid).child('gameid').val()",
".write": "root.child('games').child($gameid).child('members').child(auth.uid).child('admin').val() === true"
},
"members": {
".read": "auth != null",
"$uid": {
".read": "auth != null",
".write": "$uid == auth.uid || root.child('games').child($gameid).child('members').child(auth.uid).child('admin').val() === true"
}
},
"chat": {
".indexOn": ["created"],
".read": "auth != null && $gameid === root.child('users').child(auth.uid).child('gameid').val()",
".write": "auth != null && $gameid === root.child('users').child(auth.uid).child('gameid').val()"
},
"tipps": {
"$uid": {
".indexOn": ["category"],
".read": "$uid == auth.uid || root.child('games').child($gameid).child('members').child(auth.uid).child('admin').val() === true",
".write": "$uid === auth.uid && root.child('games').child($gameid).child('matches').child( newData.child('match').val() ).child('deadline').val() >= now && $gameid === root.child('users').child(auth.uid).child('gameid').val()",
"$tippid": {
".read": "$uid == auth.uid || root.child('games').child($gameid).child('members').child(auth.uid).child('admin').val() === true",
".write": "$uid === auth.uid && root.child('games').child($gameid).child('matches').child( newData.child('match').val() ).child('deadline').val() >= now && $gameid === root.child('users').child(auth.uid).child('gameid').val()"
}
}
},
"tipps_open": {
"public": {
".read": "auth != null && $gameid === root.child('users').child(auth.uid).child('gameid').val()",
".write": "auth != null && $gameid === root.child('users').child(auth.uid).child('gameid').val()"
},
"secure": {
"$matchid": {
".read": "auth != null && root.child('games').child($gameid).child('matches').child( $matchid ).child('deadline').val() <= now && $gameid === root.child('users').child(auth.uid).child('gameid').val() && root.child('games').child($gameid).child('matches').child( $matchid ).child('result1').val() !== null",
"$uid": {
".write": "$uid === auth.uid && root.child('games').child($gameid).child('matches').child( $matchid ).child('deadline').val() >= now && $gameid === root.child('users').child(auth.uid).child('gameid').val()"
}
}
}
},
"admin": {
"news": {
".indexOn": ["created"],
".read": "auth != null && $gameid === root.child('users').child(auth.uid).child('gameid').val()",
".write": "root.child('games').child($gameid).child('members').child(auth.uid).child('admin').val() === true && $gameid === root.child('users').child(auth.uid).child('gameid').val()"
},
"rules": {
".read": "auth != null && $gameid === root.child('users').child(auth.uid).child('gameid').val()",
".write": "root.child('games').child($gameid).child('members').child(auth.uid).child('admin').val() === true && $gameid === root.child('users').child(auth.uid).child('gameid').val()"
}
}
}
},
"users": {
".read": "auth != null",
"$uid": {
".read": "auth != null",
".write": "$uid == auth.uid"
}
}
}
}