我想设置我的firebase rulse。我想根据用户所在的地区以及存储在我的Firestore数据库中的 District 注册用户。因此,当用户要注册但该用户未登录该应用程序时,我要设置我的规则,例如任何人都可以阅读 District 集合,而其他集合必须是身份验证
所以我设置我的规则是正确的吗?
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read,write: if request.auth.uid != null;
}
match /District/{document=**} {
allow read :if true;
}
}
}