【发布时间】:2017-11-16 10:57:37
【问题描述】:
在 Firestore 中,我定义了这样的规则:
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, list: if request.data.visibility == "public";
}
}
}
然后我想获取所有公共文档,所以我使用 AngularFire 订阅集合:
this.docs = db.collection('documents', ref => ref.where("visibility", "==", 'public')).snapshotChanges();
但这会引发:
权限缺失或不足。
这应该发生吗?是否可以使用受限文档迭代集合?我不是子收藏的忠实粉丝,但这是实现这一目标的唯一方法吗?
【问题讨论】:
-
谢谢你的回答!我不会改变问题来显示正确的答案。这很令人困惑。最好有错误实现的问题和正确的答案:)
标签: security firebase angularfire google-cloud-firestore