I setup rules on Firebase like this:
"Data": {
".read": true,
"data1": {
".write": "root.child('Permissions').child(auth.uid).val() == 'admin'",
".read": true
},
"data2": {
".write": "root.child('Permissions').child(auth.uid).val() == 'admin'",
".read": "root.child('Permissions').child(auth.uid).val() == 'admin'"
}
}
and in my code, I want that when I read the node "Data", and data return should only contain "data1" node if users do not have "admin" permission, else both "data1" & "data2" are returned. Currently, when I get child "Data", both are return.