在应用程序中,firebase模拟器中的权限也被拒绝

时间:2020-06-24 11:40:45

标签: firebase firebase-storage

我是编码新手 数据库中包含以下猫

url

https://“存储桶名称” .firebaseio.com / Users / ID /“ $ uid”

 {
  "Age" : "\"2000,0,0\"",
  "Points today" : "110",
  "Questions" : {
    "All questions" : {
     
    },
    "Default questions" : {
     
    }
  },
  "Ready to challenge" : "\"yes\"",
  "Spirit" : "5",
  "account status" : "\"active\"",
  "country" : "\"AE\"",
  "email" : "\"email\"",
  "language" : "\"ar\"",
  "name" : "\"name\"",
  "password " : "\"siwasiwa\"",
  "phone number" : "\"\"",
  "points" : "120",
  "profile picture" : "\"55\"",
  "timezone" : "\"123"",
  "user name" : "\"\""

我按照如下所示的Firebase规则在项目中激活了Google身份验证

 { 
  "rules": {
    "bucket_name":{
      "Users":{
        "ID" :{
          "$uid": {
            "Age": {
              ".read": true,
                ".write": "auth.uid == $uid"
            },
              "Points today": {
              ".read": "auth != null",
                ".write": "auth.uid == $uid"
            },
               "Questions": {
              ".read": "auth != null",
                ".write": "auth.uid == $uid"
            },
              "Spirit": {
              ".read": "auth != null",
                ".write": "auth.uid == $uid"
            },
              "Ready to challenge": {
              ".read": "auth != null",
                ".write": "auth != null"
            },
              "account status": {
              ".read": "auth != null",
                ".write": "auth.uid == $uid"
            },
              "country": {
              ".read": "auth != null",
                ".write": "auth.uid == $uid"
            },
              "email": {
              ".read": "auth != null",
                ".write": "auth.uid == $uid"
            },
               "language": {
              ".read": "auth != null",
                ".write": "auth.uid == $uid"
            },
               "name": {
              ".read": true,
                ".write": "auth.uid == $uid"
            },
               "password": {
              ".read": "auth.uid == $uid",
                ".write": "auth.uid == $uid"
            },
               "phone number": {
              ".read": "auth != null",
                ".write": "auth.uid == $uid"
            },
               "points": {
              ".read": "auth != null",
                ".write": "auth.uid == $uid"
            },
               "profile picture": {
              ".read": "auth != null",
                ".write": "auth.uid == $uid"
            },
               "timezone": {
              ".read": "auth != null",
                ".write": "auth.uid == $uid"
            },
               "user name": {
              ".read": "auth != null",
                ".write": "auth.uid == $uid"
            }
          }
            
       
             
             
             
             
             
         }
      
      },
    }
    }
  }

我每次进行模拟读写的结果都会被拒绝 此外,他尝试了不止一种方法,但无济于事

1 个答案:

答案 0 :(得分:0)

您似乎正在尝试使用实时数据库安全规则来保护存储桶。那不可能云存储使用一组完全不同的规则。这些在documentation中进行了描述。