【发布时间】:2020-07-07 05:05:43
【问题描述】:
我目前正在编写一些安全规则来保护我的 Firestore 数据库,但我遇到了一些问题。我希望能够从我的查询参数中获取数据以放入我的规则中(我希望能够使用clientId):
db.collection('Users').doc(userId).where('connections', 'array-contains', clientId).get();
我希望能够在我的 firestore 安全规则中使用 clientId,以便我可以使用该客户端 ID 查询另一个集合,因为我不认为 firestore 安全规则在 get 查询中提供“where”功能。这有可能吗?
像这样:
request.auth.uid in get(/databases/$(database)/documents/Users/$(clientId)).data.connections
感谢您的帮助。
【问题讨论】:
-
您找到解决方案了吗?我正在努力解决同样的问题。
-
@matsmats 不,我没有不幸。我认为目前不可能。
标签: firebase google-cloud-firestore firebase-authentication firebase-security