【发布时间】:2021-05-20 05:43:53
【问题描述】:
我正在尝试构建一个包含聊天的应用,但出现错误消息:
[ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: [cloud_firestore/permission-denied] 调用者没有执行指定操作的权限。
我的 Firebase 规则:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{uid}{
allow write: if request.auth != null && request.auth.uid == uid;
}
match /users/{uid}{
allow read: if request.auth != null;
}
match /chat/{document=**}{
allow read: if request.auth != null;
}
}
}
如上图所示,当我写消息并发送时,它并没有出现在屏幕中,错误消息是在终端中写入的
【问题讨论】:
标签: flutter google-cloud-firestore firebase-security