-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdatabase.rules.json
36 lines (36 loc) · 1.41 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
{
"rules": {
"gameStatus": {
"$gameCode": {
".read": "root.child('players').child($gameCode).child(auth.uid).exists()||root.child('gameData').child($gameCode).child('creator').child(auth.uid).exists()",
".write": "root.child('roleData').child($gameCode).child(auth.uid).child('role').val() === 'moderator' || root.child('gameData').child($gameCode).child('creator').child(auth.uid).exists()"
}
},
"roleData": {
"$gameCode": {
".read": "data.child(auth.uid).child('role').val() === 'moderator'",
".write": "data.child(auth.uid).child('role').val() === 'moderator' || root.child('gameData').child($gameCode).child('creator').child(auth.uid).exists()",
"$playerID": {
".read": "auth.uid == $playerID ",
".write": "root.child('gameData').child($gameCode).child('creator').child(auth.uid).exists()"
}
}
},
"gameData": {
".read": "true",
".write": "true"
},
"players": {
"$gameCode": {
".read": "data.child(auth.uid).exists()",
".write": "auth.uid!=null"
}
},
"roles": {
"$gameCode": {
".read": "root.child('players').child($gameCode).child(auth.uid).exists()||root.child('gameData').child($gameCode).child('creator').child(auth.uid).exists()",
".write": "root.child('gameData').child($gameCode).child('creator').child(auth.uid).exists()"
}
}
}
}