-
Notifications
You must be signed in to change notification settings - Fork 30
/
database.rules.json
93 lines (91 loc) · 3.91 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
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
83
84
85
86
87
88
89
90
91
92
93
{
"rules": {
"userTokens": {
"$uid": {
/* this should be only cloud functions */
".write": "auth != null",
"token": {
".read": "auth.uid == 'some-uid'",
".validate": "auth.uid == 'some-uid'"
},
"$other": {
".read": false,
".write": false
}
}
},
"users": {
"$uid": {
".read": "$uid == auth.uid || root.child('users').child(auth.uid).child('isVerified').val() == true",
".write": "auth.uid == 'some-uid' || $uid == auth.uid || root.child('users').child(auth.uid).child('isVerified').val() == true",
"shellMailId": {
".validate": "$uid == auth.uid && newData.val().endsWith('@gmail.com') && !newData.val().contains('<') && !newData.val().contains('(')"
},
"isVerified": {
".read": "auth != null",
".write": true,
".validate": "newData.isBoolean() && auth.uid != $uid"
},
"capacity": {
".validate": "$uid == auth.uid && newData.isNumber() && newData.val() < 9"
},
"car": {
".validate": "$uid == auth.uid && newData.isString() && newData.val().length < 30 && !newData.val().contains('<') && !newData.val().contains('(')"
},
"homeLocation": {
".validate": "$uid == auth.uid && newData.isString() && newData.val().length < 50 && !newData.val().contains('<') && !newData.val().contains('(')"
},
"remainingSeats": {
//".validate": "newData.val() > -1",
//".write": "$uid != auth.uid"
".validate": "auth.uid == 'some-uid'"
},
"vehicleNumber": {
".validate": "$uid == auth.uid && newData.val().length < 15 && !newData.val().contains('<') && !newData.val().contains('(')"
},
"$other": {
".read": false,
".write": false
}
}
},
"activeRoutes": {
"$uid": {
".read": "root.child('users').child(auth.uid).child('isVerified').val() == true",
".write": "$uid == auth.uid && root.child('users').child(auth.uid).child('isVerified').val() == true"
}
},
"userroutes": {
".read": "root.child('users').child(auth.uid).child('isVerified').val() == true",
".write": "root.child('users').child(auth.uid).child('isVerified').val() == true",
".indexOn": "g",
"$uid": {
".validate": "$uid.beginsWith(auth.uid)",
".indexOn": "g"
}
},
"routes": {
"$uid": {
".read": "root.child('users').child(auth.uid).child('isVerified').val() == true",
".write": "$uid == auth.uid && root.child('users').child(auth.uid).child('isVerified').val() == true",
".indexOn": [
"isDeleted",
"isActive"
]
}
},
"requests": {
".read": "auth.uid == 'some-uid' || root.child('users').child(auth.uid).child('isVerified').val() == true",
".indexOn": "requestedTo",
"$uid": {
".read": " root.child('users').child(auth.uid).child('isVerified').val() == true",
".write": "$uid == auth.uid && root.child('users').child(auth.uid).child('isVerified').val() == true",
".indexOn": "requestedTo"
}
},
"$other": {
".read": false,
".write": false
}
}
}