【发布时间】:2021-05-14 03:49:18
【问题描述】:
我有这个安全规则代码
match /{path=**}/favorited/{userUID} {
allow create, update, read: if request.auth.uid == userUID;
}
这是我收到的错误消息
W/Firestore(6236):(21.3.0)[Firestore]:监听查询(collectionGroup=favorited where userUID == abcdefghijklmnopqrstuvwxyz and favorite == true order by -updatedAt,-name ) 失败:状态{code=PERMISSION_DENIED, description=缺少或权限不足。, cause=null}
我使用的查询是
Firestore.instance.collectionGroup('favorited')
.where('userUID', isEqualTo: user.uid)
.where('favorite', isEqualTo: true)
.orderBy('updatedAt', descending: true).snapshots()
我不知道 collectionGroup 的安全规则的哪一部分出错了。 当没有安全规则时,查询代码工作正常。 我在这里错过了什么?
【问题讨论】:
标签: flutter google-cloud-firestore firebase-security