【发布时间】:2018-02-25 23:20:48
【问题描述】:
我在这里真的很摸不着头脑,我一直在尽可能多地阅读许多其他案例。我是 Firebase 的新手,但对它有所了解。我想将数据库的某些记录限制为某些用户。所以这是我的 JSON:
"accounts" : {
"13asdf313" : {
"dog" : "bacon",
"email" : "luis@fakeemail.com",
"first" : "luis",
"last" : "xxxx"
},
"HlELrrGDbiMKgxxxx" : {
"name" : "Luis"
},
"anthony" : {
"email" : "anthony@fakeemail.com",
"last" : "xxxx",
"name" : "anthony"
},
"jpSq6UzX0mcAvExxxx" : {
"name" : "anthony"
}
}
以下是根据我阅读的内容制定的规则:
{
"rules": {
"accounts":{
"$uid":{
".read": "auth.uid == $uid",
".write": "auth.uid == $uid"
}
},
}
}
在模拟器中,我使用了底部条件(我什至将 /accounts 放在位置字段中)。我使用了 UID:HlELrrGDbiMKgxxxx,直接从 Firebase 帐户列表复制。
这总是失败
我做错了什么?
【问题讨论】:
标签: firebase firebase-realtime-database firebase-security firebase-console