Firebase:允许读取 属性 个名称,但不允许读取内容
Firebase: Allow Read of property names, but not content
允许任何人读取 属性 名称但阻止未经授权的人读取值内容的正确数据库规则是什么?这是一个订单系统,我在设置 属性 值之前检查是否有相同的 ID。还是有另一种方法可以做到这一点?谢谢。
以下是我目前所了解的内容。
{
"rules": {
"orders": {
".read": true,
".write": true,
}
}
}
在 Firebase 数据库安全模型中,您可以访问整个节点,也可以不访问它。您不能授予用户访问集合中每个节点的子集的权限。参见 rules cascade in the documentation。
通常情况下,您会将集合分成两部分:一部分包含 public 部分,另一部分包含私有部分。
{
"rules": {
"ordernames": {
".read": true,
},
"orders": {
".read": "auth !== null",
}
}
}
另见:
- Firebase Security Rules: Public vs. Private Data
允许任何人读取 属性 名称但阻止未经授权的人读取值内容的正确数据库规则是什么?这是一个订单系统,我在设置 属性 值之前检查是否有相同的 ID。还是有另一种方法可以做到这一点?谢谢。
以下是我目前所了解的内容。
{
"rules": {
"orders": {
".read": true,
".write": true,
}
}
}
在 Firebase 数据库安全模型中,您可以访问整个节点,也可以不访问它。您不能授予用户访问集合中每个节点的子集的权限。参见 rules cascade in the documentation。
通常情况下,您会将集合分成两部分:一部分包含 public 部分,另一部分包含私有部分。
{
"rules": {
"ordernames": {
".read": true,
},
"orders": {
".read": "auth !== null",
}
}
}
另见:
- Firebase Security Rules: Public vs. Private Data