-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.rules.json
More file actions
82 lines (72 loc) · 2.61 KB
/
Copy pathdatabase.rules.json
File metadata and controls
82 lines (72 loc) · 2.61 KB
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
{
"rules": {
".read": false,
".write": false,
"presence": {
"$uid": {
".read": "auth != null && auth.uid === $uid",
".write": "auth != null && auth.uid === $uid"
}
},
"trackerMappings": {
"$uuid": {
".read": "auth != null && data.child('uid').val() === auth.uid",
".write": "auth != null && (!data.exists() || data.child('uid').val() === auth.uid) && (!newData.exists() || (newData.child('uid').val() === auth.uid && (newData.child('busId').val() === auth.token.assignedBusId || ('bus-a' + newData.child('busId').val()) === auth.token.assignedBusId || auth.token.assignedBusId == null || auth.token.assignedBusId == '')))"
}
},
"trackerCandidates": {
"$busId": {
".read": "auth != null",
"$uuid": {
".write": "auth != null && (auth.token.role === 'student' || auth.token.role == null) && (auth.token.assignedBusId === $busId || ('bus-a' + auth.token.assignedBusId) === $busId || auth.token.assignedBusId == null || auth.token.assignedBusId == '')"
}
}
},
"approachingStudents": {
"$busId": {
".read": "auth != null",
"$uuid": {
".write": "auth != null && (auth.token.role === 'student' || auth.token.role == null) && (auth.token.assignedBusId === $busId || ('bus-a' + auth.token.assignedBusId) === $busId || auth.token.assignedBusId == null || auth.token.assignedBusId == '')"
}
}
},
"trackerAssignments": {
"$busId": {
".read": "auth != null",
"leader": {
".write": "auth != null && (auth.token.assignedBusId === $busId || ('bus-a' + auth.token.assignedBusId) === $busId || auth.token.assignedBusId == null || auth.token.assignedBusId == '')"
}
}
},
"busLocations": {
"$busId": {
".read": "auth != null",
".write": "auth != null"
}
},
"busHealth": {
"$busId": {
".read": "auth != null",
".write": "auth != null"
}
},
"busesByGeohash": {
"$geohash": {
".read": "auth != null && (auth.token.role === 'admin' || auth.token.tier === 'god')",
".write": false
}
},
"busPaths": {
"$busId": {
".read": "auth != null && (auth.token.role === 'admin' || auth.token.tier === 'god' || auth.token.assignedBusId === $busId || auth.token.assignedBusId == null || auth.token.assignedBusId == '')",
".write": false
}
},
"sessions": {
"$uid": {
".read": "auth != null && auth.uid === $uid",
".write": "auth != null && auth.uid === $uid"
}
}
}
}