【发布时间】:2020-04-07 19:53:54
【问题描述】:
在我的 Firestore 规则中,这允许我查询所有用户“组织”的列表:
match /organizations/{orgId}{
allow read: if request.auth.uid in resource.data.members;
}
其中 members 是一组用户 ID。
但是,如果我将其更改为使用声明:
match /organizations/{orgId}{
allow read: if orgId in request.auth.token.organizations;
}
其中 organizations 是组织 ID 的列表。
它似乎适用于:
match /organizations/{orgId}{
allow read: if request.auth.token.organizations[orgId] == true;
}
它将让我访问文档,但不是文档列表。有没有办法解决这个问题?
【问题讨论】:
-
仅供参考:如果您要对问题进行补充或更改,您可以直接编辑问题而不是添加评论。
-
感谢@DougStevenson 还在学习!
标签: google-cloud-firestore firebase-authentication firebase-security