I am trying to extend a social android aap, currently its rules are public, its data structure is something like this,
{
"posts" : {
"postId1" : {
"authorId" : "abcd",
},
"postId2" : {
"authorId" : "abcd",
},
"postId3" : {
"authorId2" : "wxyz",
},
"postId4" : {
"authorId2" : "wxyz",
}
}
}
I want to allow an authenticated user to create and delete his own post in "posts" node I tried this,
{
"rules": {
".read":"auth.uid != null",
".write":false,
"questions": {
"$uid": {
".write": "$uid === auth.uid"
}
}
}}
But this does not allow a user to create a post although a user can edit or delete his pre-existing post in "posts" node, it seems that there is no write permission within the "posts" node. But if i allow write permission for "posts" then due to cascading rules, every authenticated user can access other's data. How can I achieve my desired functionality?