I am a bit stuck on my project.
I have a list of users which include the events allowed. I have a list of events with users allowed.
I want to allow a user to get only the list of their events in "users". And of course, I want the json sent to only include the the content of their events.
See the Database
See the Rules
Thank you for your help
If I understand correctly, you want to allow a user access (read/write ?) to a specific part of the your database/events.
According to the Firebase Secure Your Data docs, you can specify who gets what. If you want the current user to be able to see the data in an event, I think this rule should work :
{
"rules": {
"events": {// allows read to /events
"$eventID": {
".read": "data.child('users').child(auth.uid).exists()",
".write": false
}
}
}
}
If you want the user to be able to edit the information as well, copy the rule from .read
to .write
.
As for sending the JSON of this event specifically, you need to do it with a db query to that specific node in the DB.