I'm very new to firebase and I have been attempting to create rules that allow access to all the data aside from the "private_info" object. I have tried numerous ways to avoid it from just cascading over and making everything readable or not however, I have not been successful in stopping read access to that (if its even possible).
Data Structure:
{
"usersRef": {
"Not_UID_Other_Random_Key": {
"item_info": {
"contactEmail": "Test",
"contactPhone": "Test",
"itemDate": "2018-10-15",
"itemDescription": "Test",
"itemName": "Test",
"location": "{\"lat\":38.980166804362646,\"lng\":-76.94037550926208}"
},
"private_info": {
"email": "hi@gmail.com",
"userId": "randomkey"
}
}
}
}
Rules:
I have been reading and restructuring my data and I understand that it would be best to store items by UID and not by some random key generated by Push. These are the rules i have been playing with:
{
"rules": {
"item_info": {
".read": true,
".write": "auth !== null",
"private_info": {
".read": false
}
}
}
}