Firebase数据库规则Base64编码

时间:2018-09-14 07:42:15

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

我有如下数据库:

Emails/$uid: test@email.com

Users/base64encode(test@email.com)  name: Test Surname: Test 

Firebase向我发送“您的实时数据库具有不安全的规则”

当前我的规则是:

{
      "rules": {
        ".read": "auth != null",
        ".write": "auth != null"
      }
    }

我已经更改了有关“电子邮件”的规则

"Emails": {
    "$uid": {
      ".read": "$uid === auth.uid",
      ".write": "$uid === auth.uid"
    }
  }

如何为“用户”文件夹编写规则?如何在规则中编码“ root.child('Emails')。child(auth.uid).val()”?我尝试过的是这样:

"Users": {
        "$encodedmail": {
          ".read": "$encodedmail === root.child('Emails').child(auth.uid).val()",
          ".write": "$encodedmail === root.child('Emails').child(auth.uid).val()"
        }
      } 

0 个答案:

没有答案