Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (37 sloc) 1.12 KB
{
"rules": {
"<your-geofire-node>": {
// Allow anyone to read the GeoFire index
".read": true,
// Index each location's geohash for faster querying
".indexOn": ["g"],
// Schema validation
"$key": {
// Allow anyone to add, update, or remove keys in the GeoFire index
".write": true,
// Key validation
".validate": "newData.hasChildren(['g', 'l']) && newData.getPriority().length <= 22 && newData.getPriority().length > 0",
// Geohash validation
"g": {
".validate": "newData.val() == newData.parent().getPriority()"
},
// Location coordinates validation
"l": {
"0" : {
".validate": "newData.isNumber() && newData.val() >= -90 && newData.val() <= 90"
},
"1" : {
".validate": "newData.isNumber() && newData.val() >= -180 && newData.val() <= 180"
},
"$other": {
".validate": false
}
},
// Don't allow any other keys to be written
"$other": {
".validate": false
}
}
}
}
}