【发布时间】:2017-07-16 02:36:36
【问题描述】:
我正在尝试编写安全规则,但我在编写它时有点困惑。就我而言,我没有使用 Firebase 对用户进行身份验证,但我在数据库中有节点,该节点具有由用户名命名的子节点。我正在尝试实现这样的逻辑:对于该节点的任何子节点,如果值为真,那么他可以继续前进,否则不能。这是我的示例节点
"Customers":{
"John":"true",
"Jack":"false"
}
"Messages":{
"Message1":{
....
},
},
这是我感到困惑的规则节点。我尝试使用“$”通配符变量,但出现该变量未知的错误。
"rules":{
"Messages":{
".read":"root.child('Customers').child($name).val()===true",
".write":"root.child('Customers').child($name).val()===true"
}
}
我认为“$”变量不能这样使用。那么我该怎么做呢?
【问题讨论】:
标签: firebase-realtime-database firebase-security