【发布时间】:2022-01-11 13:01:02
【问题描述】:
我使用集合分组的子集合,所以(在我的理解中)我必须使用通配符:
match /{path=**}/actions/{action} {
allow read, write: if request.auth != null;
}
到目前为止,这是有效的。 在实施另一条规则时它也有效:
match /{path=**}/actions/{action} {
allow read, write: if request.auth != null
&& request.auth.token.email !='';
}
但是我想检查用户是否可以访问文档中的数据并且出现了问题:
match /{path=**}/actions/{action} {
allow read, write: if request.auth != null
&& request.auth.token.email in resource.data.access;
}
导致
FirebaseError: Missing or insufficient permissions.
与:
this.afs.collectionGroup("actions", ref =>
ref.where("owner.email", "==", user.email)
).valueChanges({ idField: 'id' }).pipe(take(1))
到目前为止,我找不到有关如何访问通配符中数据的更多信息。
【问题讨论】:
-
您能否编辑您的问题以显示也产生此错误的代码?
-
我编辑了我的问题
标签: firebase google-cloud-firestore firebase-security