Simple quoting tool. Want to show prices/pricing to 'dealers' only. Is this structure below appropriate?
If I put a more specific rule on the builds\$key\price
node (to restrict price access) then it seems that non-dealers trying to read .once
on builds\-Ke_yHGa-c-acXF5_J9B
would fail.
So, must I build out a separate prices
root node? I think so...?
and then
{
"...some path...": {
".read": "root.child("dealers/" + auth.uid).val() === true"
}
}
Thanks in advance.
{
"builds" : {
"-Ke_yHGa-c-acXF5_J9B" : {
"created" : 1488843260381,
"last modified" : false,
"model" : "1VR",
"price" : "1999.00",
"status" : "saved",
"title" : "test build",
"uid" : "q5b9AJgWATdbNF5y2JZctitx1Qx2"
}
},
"dealers" : {
"DsZ1wSUOmsceMKqCKLZwhpg1vjA3" : true,
"R9s2qY6p87cas750wJz5wAB3sfJ3" : false,
"q5b9AJgWATdbNF5y2JZctitx1Qx2" : true
},
"users" : {
"DsZ1wSUOmsceMKqCKLZwhpg1vjC2" : {
"displayName" : "Eric Doe",
"photoUrl" : "http://abs.twimg.com/sticky/default_profile_images/default_profile_3_normal.png",
"provider" : "twitter.com"
},
"R9s2qY6p87cas750wJz5wAB3sfk5" : {
"displayName" : "Ron Royston",
"email" : "rrrrrrrr@gmail.com",
"provider" : "password"
},
"q5b9AJgWATdbNF5y2JZctitx1Qx2" : {
"displayName" : "Ron Royston",
"photoUrl" : "http://pbs.twimg.com/profile_images/809222728456675365/C-rlXjaN_normal.jpg",
"provider" : "twitter.com"
}
}
}