In a database like this:
{
"users": {
"simplelogin:213": {
"provider": "password",
"name": "bobtony",
"friends": {
"Andrew Lee": true,
"James Tamplin": true
}
},
"twitter:123": {
"provider": "twitter",
"name": "Andrew Lee",
"friends": {}
},
"facebook:456": {
"provider": "facebook",
"name": "James Tamplin",
"friends": {}
}
},
"messages": {
"simplelogin:213": {
"-JkpwAnieKjQVsdtPD4m" : {
"content" : "Hello World"
}
}
}
}
Considering that bobtony add Andrew Lee as his friend, how Andrew Lee can read bobtony messages? A similar question asked here, but without good solution. I know I can have a rule to allow reading the message, but the "friend" users just does not to know the path to read them.
Update: After spend some time thinking, i got:
{
"users": {
"user1": {
"name": "bobtony",
"partners": {
"user2": {
"accepted": true
}
},
"customers":{
"customer1": true,
"customer2": true
// hundreds of clients
},
"orders":{
"order1": true,
"order2": true
// hundreds of orders
}
}
},
"customers": {
"customer1": {
"name" : "james"
}
}
}
So, would be ok to have something like this? This way I can traverse my own customers and my partners customers.