这个firebase-security规则是如何工作的

时间:2016-10-26 13:51:59

标签: firebase firebase-realtime-database firebase-security

我尝试了解此代码示例的工作原理:

{
  "rules": {
    "users": {
      "$uid": {
        ".write": "$uid === auth.uid"
      }
    }
  }
}

现在纠正我,但是,这是一个正确的结果吗?根据上述规则,Bob doe永远不能写入John Doe数据?

  "users": {
    "This is the id in firebase for Bob doe": {
      "name ": "Bob doe",
      "time": 1459361875337
    },
    "This is the id in firebase for John doe": {
      "name": "John Doe",
      "time": 1459361875337
    }

1 个答案:

答案 0 :(得分:1)

根据规则,只有uid为This is the id in firebase for John doe的用户才能在该节点下写入数据。