英文:
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=**} {
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论