【发布时间】:2020-07-17 00:44:57
【问题描述】:
在我的 android 应用上,我使用 Firebase Firestore 存储“用户名”集合,以便在用户登录之前查询以检查所选用户名是否可用。
目前我的项目有 2 个主要集合:“用户”和“用户名”。我试图仅在“用户名”集合中允许读取访问权限。我的程序失败了,因为当我尝试在用户通过身份验证之前查询“用户名”集合时,它说我没有正确的权限。
我的规则非常基本,但我想知道是否可以以某种方式修改它们以使我的项目正常工作。规则如下:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if request.auth != null;
}
}
}
firestore 数据库是什么样子的视觉概念:
【问题讨论】:
标签: firebase google-cloud-firestore firebase-authentication firebase-security