【发布时间】:2020-11-03 23:38:56
【问题描述】:
我总是收到关于我的 Cloud Firestore 安全规则不安全的邮件。
每个用户都可以读取整个数据库
但我不明白?这些是我的规则:
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userID} {
allow read;
allow write: if request.auth != null;
}
match /users/{userId}/wishlists/{restOfPath=**} {
allow read,write: if request.auth != null;
}
}
}
users 应该对每个人都可读,但其他所有内容都应该仅限于授权用户。我在这里错过了什么?
【问题讨论】:
-
我认为这只是来自 Firestore 的警告,建议您在需要向所有用户开放数据库访问权限时尽量避免此类情况。你可以阅读更多关于规则here
标签: firebase google-cloud-firestore firebase-security