1
所以我有这个数据库的结构:Firebase安全规则,设置孩子不可读?
在型材我要寄&提供商名称只为管理员和 用户名可读为每个登录的用户可读。 我如何实现这一目标?
这里是我的规则:
{
"rules":
{
"users":
{
"$uid":
{
// grants write access to the owner of this user account whose uid must exactly match the key ($uid)
".write": "auth !== null && auth.uid === $uid",
"profile":
{
// grants read access only for registered users
".read": "auth !== null",
"email":
{
// This doesn't work with firebase as I was reading doc.
".read": false
}
}
}
}
}
}
当您有权读取该节点中的所有数据时,Firebase将只返回一个节点。因此,您必须对数据建模,以便将公共数据和私有数据存储在不同的顶级节点中。 (https://www.firebase.com/docs/security/guide/securing-data.html#section-filter) –
请给我看一个简单的例子吗? – Dragod83