the goal I would to achieve is to show to an authenticated user a list of "Events" shared with other users, and in particular, only the events where the user itself is member of.
the initial structure I had in mind was:
events:{
"eventId1":{
"title":"some text",
"members":{
"myAuthUID":true,
"anotheUserUId":true
}
}
"eventId2":{
"title":"some text",
"members":{
"anotheUserUId":true
}
}
}
the rules I put in place is the following one. but it failed the porpouse:
{
"rules": {
".read":"auth.uid !== null",
".write": "auth.uid !== null",
"events":{
"$evtId":{
".read":"data.child('members').child(auth.uid).exists()",
".write": "data.child('admins').hasChild(auth.uid)",
}
}
}
}
calling /events all the events are showm
calling /events/eventId2 with myAuthUID it succeed.
the result must be, for sure, to show only the eventId1 to muAuthUser
could you please help me to structure better the data model and/or refund the rule?
meanwhile I'll look for a solution to this simple problem :)
thanks