-
Notifications
You must be signed in to change notification settings - Fork 59
/
database.rules.json
50 lines (50 loc) · 1.48 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
{
"rules": {
"rooms": {
"$roomId": {
".read": true,
".write": "!data.exists() || data.child('owner').val() === auth.uid",
"remotePlayers": {
"$playerId": {
".read": true,
".write": "!data.exists() || $playerId === auth.uid"
}
}
},
".indexOn": "updatedAt"
},
"roomsData": {
"$roomId": {
".read": "auth.uid != null",
".write": "!data.exists() || data.child('owner').val() === auth.uid"
},
".indexOn": "updatedAt"
},
"roomsRemotePlayers": {
"$roomId": {
".read": "root.child('roomsData/'+$roomId+'/owner').val() === auth.uid",
".write": "!data.exists() || root.child('roomsData/'+$roomId+'/owner').val() === auth.uid",
"$playerId": {
".read": "$playerId === auth.uid || root.child('roomsData/'+$roomId+'/owner').val() === auth.uid",
".write": "$playerId === auth.uid || root.child('roomsData/'+$roomId+'/owner').val() === auth.uid"
}
}
},
"roomsLocations": {
"$roomId": {
".read": "auth.uid != null",
".write": "!data.exists() || root.child('roomsData/'+$roomId+'/owner').val() === auth.uid"
}
},
"exports": {
"$exportId": {
".read": "auth.uid != null",
".write": "!data.exists() || data.child('owner').val() === auth.uid",
},
".indexOn": "createdAt"
},
"translations": {
".read": "auth.uid != null"
}
}
}