【发布时间】:2018-04-29 10:56:51
【问题描述】:
我正在尝试扩展social android aap,目前它的规则是公开的,它的数据结构是这样的,
{
"posts" : {
"postId1" : {
"authorId" : "abcd",
},
"postId2" : {
"authorId" : "abcd",
},
"postId3" : {
"authorId2" : "wxyz",
},
"postId4" : {
"authorId2" : "wxyz",
}
}
}
我想允许经过身份验证的用户在“帖子”节点中创建和删除他自己的帖子 我试过了,
{
"rules": {
".read":"auth.uid != null",
".write":false,
"questions": {
"$uid": {
".write": "$uid === auth.uid"
}
}
}}
但这不允许用户创建帖子,尽管用户可以在“帖子”节点中编辑或删除他预先存在的帖子,但似乎“帖子”节点内没有写入权限。 但是,如果我允许“帖子”的写权限,那么由于级联规则,每个经过身份验证的用户都可以访问其他人的数据。如何实现我想要的功能?
【问题讨论】:
标签: android firebase-realtime-database firebase-security