-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.rules.json
More file actions
33 lines (33 loc) 路 1.24 KB
/
Copy pathdatabase.rules.json
File metadata and controls
33 lines (33 loc) 路 1.24 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
{
"rules": {
"vehicles": {
".read": "auth != null",
"$vehicleId": {
".write": "auth != null && (root.child('users').child(auth.uid).child('role').val() === 'driver' || root.child('users').child(auth.uid).child('role').val() === 'admin')",
"location": {
".write": "auth != null && root.child('users').child(auth.uid).child('role').val() === 'driver'"
}
}
},
"users": {
".read": "auth != null && root.child('users').child(auth.uid).child('role').val() === 'admin'",
"$uid": {
".read": "auth != null && auth.uid === $uid",
".write": "auth != null && (auth.uid === $uid || root.child('users').child(auth.uid).child('role').val() === 'admin')"
}
},
"drivers": {
".read": "auth != null && root.child('users').child(auth.uid).child('role').val() === 'admin'",
"$driverId": {
".read": "auth != null && auth.uid === $driverId",
".write": "auth != null && root.child('users').child(auth.uid).child('role').val() === 'admin'"
}
},
"boardingPoints": {
".read": "auth != null",
"$vehicleId": {
".write": "auth != null && root.child('users').child(auth.uid).child('role').val() === 'admin'"
}
}
}
}