Firestore规则允许使用特定文档,但不允许收集

时间:2020-06-18 09:16:07

标签: firebase google-cloud-firestore firebase-security

我需要允许用户阅读特定的文档/ customers / cumstomerkey,但不能获取整个文档集。我该如何实现?以下规则允许访问以获取整个集合:

  match /customers/{document=**} {
       allow read, write: if true;
  }

1 个答案:

答案 0 :(得分:2)

您将需要阅读有关安全规则的granular operations。如果您只有一个应该可获取的文档,只需调出路径并允许target = colorList[num]对此进行访问:

get