【发布时间】:2021-06-10 21:25:32
【问题描述】:
这是我当前的 Cloud Firestore 规则:https://pastebin.com/rQBacfLm
在这个截图中你可以看到我当前的数据库结构:
这是我的 Flutter 应用程序中的代码,我试图用它来获取“所有者”等于用户 UID 的船流:
_databaseReference.collection("boats").where("owner", isEqualTo: "My UID").snapshots()
我不知道规则中是否存在一般错误,或者它是否与流有关。我认为这可能是规则的问题,但我不知道出了什么问题。有人能发现规则中的错误吗?
这是来自控制台的日志:
W/Firestore(26299): (22.0.1) [Firestore]: Listen for Query(target=Query(boats where owner == # com.google.firestore.v1.Value@628107b8
W/Firestore(26299): integer_value: 0
W/Firestore(26299): string_value: "My UID" order by __name__);limitType=LIMIT_TO_FIRST) failed: Status{code=PERMISSION_DENIED, description=Missing or insufficient permissions., cause=null}
W/Firestore(26299): (22.0.1) [Firestore]: Listen for Query(target=Query(boats where share array_contains # com.google.firestore.v1.Value@628107b8
W/Firestore(26299): integer_value: 0
W/Firestore(26299): string_value: "My UID" order by __name__);limitType=LIMIT_TO_FIRST) failed: Status{code=PERMISSION_DENIED, description=Missing or insufficient permissions., cause=null}
重要信息:“我的 UID”只是一个占位符,实际上是我的真实 UID。这不是问题!
【问题讨论】:
标签: firebase flutter google-cloud-firestore firebase-security