1
votes

This is the structure of my firebase real time database. I want to block read access when accessing the whole words object but make it allowed when accessing single nodes in words. The purpose is preventing users from reading the whole words at once. How can i do it with security rules?

My firebase database structure

1

1 Answers

0
votes

You can do this by using a $ wildcard:

{
  "rules": {
    "words": {
      ".read" false,
      "$word: {
        ".read" true
      }
    }
  }
}

So on the entire words node the read is denied, but then the $word matches any child node of words an allows reading there.