This repository has been archived by the owner on Aug 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
database.rules.json.bak
79 lines (78 loc) · 2.51 KB
/
database.rules.json.bak
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
{"rules":
{
".read": "auth.uid === 'secret-service-worker'",
".write":"auth.uid === 'secret-service-worker'",
"users": {
"$uid": {
".read": "auth != null",
".write":"auth != null && auth.uid === $uid",
"balance": {
".validate": "auth.uid === 'secret-service-worker' || (!data.exists() && newData.val() === 100) || data.val() === newData.val() || (data.exists() && newData.exists() && newData.isNumber() && newData.val() >= 0)"
},
"wagers": {
"$wager_id": {
".validate": "auth.uid === 'secret-service-worker' || root.child('events/'+root.child('bets/'+$wager_id+'/event_id').val()+'/air_at').val() >= now",
"wager": {
".validate": "auth.uid === 'secret-service-worker' ||
(!newData.exists() && data.val() === 0) ||
(newData.val() >= 0 && (
(data.exists() && data.parent().parent().parent().child('balance').val() + data.val() - newData.val() === newData.parent().parent().parent().child('balance').val()) ||
(!data.exists() && data.parent().parent().parent().child('balance').val() - newData.val() === newData.parent().parent().parent().child('balance').val())
))"
}
}
}
}
},
"secure": {
"$uid": {
".read": "auth != null && auth.uid === $uid",
".write": "auth != null && auth.uid === $uid"
}
},
"names": {
"$nameid": {
".read": true,
".write": "auth != null && (!data.exists() || (data.exists() && !newData.exists() && data.val() === auth.uid))",
}
},
"series": {
".read": true,
".write": "auth != null && auth.uid === 'Jr9wO5CW1uX2li5HLFepQL9w5bn2'"
},
"seasons": {
".read": true,
".write": "auth != null && auth.uid === 'Jr9wO5CW1uX2li5HLFepQL9w5bn2'"
},
"episodes": {
".read": true,
".write": "auth != null && auth.uid === 'Jr9wO5CW1uX2li5HLFepQL9w5bn2'"
},
"events": {
".read": true
},
"bets": {
".read": true,
".write": "auth != null && auth.uid === 'Jr9wO5CW1uX2li5HLFepQL9w5bn2'"
},
"stats": {
".read": true
},
"labels": {
"$labelid": {
".read": true
}
},
"leaderboard": {
".read": true,
"$uid": {
"displayName": {
".write": "$uid === auth.uid && data.exists()"
},
"anon": {
".write": "$uid === auth.uid && data.exists()"
}
}
}
}
}