Flutter Firebase权限被拒绝

huangapple go评论63阅读模式
英文:

Flutter Firebase permission-denied

问题

I'm got an error when try to set data to Firestore Firebase

FirebaseException ([cloud_firestore/permission-denied] The caller does not have permission to execute the specified operation.)

Firestore Firebase rules

rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { match /{document=**} { allow read, write: if true; } } }

My try

await usersCollection.doc(cred.user!.uid).set({ "email": email, "name": name, "password": password, "createdate": DateTime.now().toString(), });

英文:

I'm got an error when try to set data to Firestore Firebase

FirebaseException ([cloud_firestore/permission-denied] The caller does not have permission to execute the specified operation.)

Firestore Firebase rules

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if true;
    }
  }
}

My try

 await usersCollection.doc(cred.user!.uid).set({
      "email": email,
      "name": name,
      "password": password,
      "createdate": DateTime.now().toString(),
    });

答案1

得分: 1

好的,以下是翻译好的部分:

似乎在这里缺少集合名称

尝试

match /databases/{database}/documents {
   match /collectionName/{document=**} {
英文:

Seems like the collection name is missing here

try

match /databases/{database}/documents {
   match /collectionName/{document=**} {

huangapple
  • 本文由 发表于 2023年3月23日 12:29:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/75819262.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定