0
votes

I need to allow a user to read a specific document /customers/cumstomerkey but not to get the whole collection. How can I achieve that? Following rule allows access to get the whole collection:

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

1 Answers

2
votes

You will want to read about granular operations in security rules. If you have a single document that should be gettable, just call out the path and allow get access on just that:

match /customers/cumstomerkey {
  allow get;
}