我已经按照docs
中的规则进行设置{
"rules": {
"foo": {
"$uid": {
".read": "$uid === auth.uid"
".write": "$uid === auth.uid"
}
}
}
}
问题是当我尝试使用模拟器时,我将auth设置为“ Custom”,然后在规则部分检查$uid
。
结果我得到了:
Type set
Location /foo
Data { "key": "value" }
Auth { "provider": "custom", "uid": "5d8a2cf9-e0b1-4332-9518-d1fb101549e2" }
Admin false
**Write denied**
我想念什么?
答案 0 :(得分:0)
感谢@Curse,他提到我已经弄乱了哪些规则应适用于资源的范围。
这是一个解决方案:
{
"rules": {
"foo": {
".read": "true",
".write": "true", // <-- Didn't have this before
"$uid": {
".read": "$uid === auth.uid",
".write": "$uid === auth.uid"
}
}
}
}