I'm working on an app using Ionic Framework and Firebase. I have the following data structure on Firebase:
Users {
mary@fb,com: {
Group: {
group123: {
Contacts: {[email protected], [email protected], etc. }
}
group456: {
Contacts: {[email protected], [email protected], etc. }
}
}
}
[email protected]: {}
[email protected]: {}
etc.
}
Users on the app can create groups and invite their friends to a group.
I'm trying to figure out how to give "[email protected]", "[email protected]" etc. access to the path Users/mary@fb,com/Group/group123 using Firebase rules. I'm also having trouble giving mary@fb,com permissions to read and write. How do I use rules like below for using a custom Unique ID like the the User's email?
{
"rules": {
"Users": {
"$user_id": {
".read": "$user_id === auth.uid",
".write": "$user_id === auth.uid"
}
}
}
}