不明白为什么获得许可拒绝错误

问题描述 投票:0回答:1

我不明白为什么我会获得以下代码的权限拒绝错误。

stream = FirebaseFirestore.instance .collection('events') .doc(widget.event.id) .collection('invitations') .snapshots();
    match /events/{eventId} {
      match /invitations/{email} {
        allow read: if
            request.auth.token.email == email ||
            request.auth.token.email == get(/databases/$(database)/documents/events/$(eventId)).data.user_id;
      }
    }
    
firebase google-cloud-firestore firebase-security
1个回答
0
投票
request.auth.token.email

或其他文档中的字段。 FireBase安全规则不是过滤的(您应该阅读此文档并了解其在说什么)。 规则不会查看每个文档,并确定用户可能会找到哪些文档。 规则要求“查询请求”仅限规则允许的特定文档,这意味着您应该仅代码get()一个符合规则要求的单个文档。

	

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.