This is what my data currently looks like:
{
"teams" : {
"-K04MPQOs2aXBCyCvYNM" : {
"members_id" : [ "google:xyz","facebook:1234" ],
"name" : "team A",
"owner_id" : "google:xyz"
},
"-K04MrZxqPJru9-a_GjT" : {
"member_ids" : [ "facebook:1234" ],
"name" : "Team B",
"owner_id" : "facebook:1234"
}
},
"users" : {
"facebook:1234" : {
"name" : "John"
},
"google:xyz" : {
"name" : "Jane"
}
}
}
team A was created by Jane and should be readable by her and John. Team B was created by John and should only be readable by him.
The rules I have are not allowing Jane to see any of the teams.
{
"rules": {
"teams": {
"$team":{
".read": "data.child('owner_id').val() == auth.uid",
".write": true
}
}
}
}
How do i make it so that only the owner and the members of a team can list the teams?