Currently I have a simple todo app whereby users can create a list then tick off items as done. The data is structured as follows: \'/acc_\' + USER_ID +\'/done\' and \'/acc_
Since the user decides who'd they like to share the list with, I'd store that information in the user data itself. For example:
{
"rules": {
"$userPath": {
".write": "$userPath == 'acc_' + auth.id",
".read": "$userPath == 'acc_' + auth.id || root.child($userPath).child('shared').hasChild(auth.id)"
}
}
}
And then store the list of users the data is shared with in acc_userid/shared/