0

I'm trying to redo this example from the official firebase docs: https://www.firebase.com/docs/security/quickstart.html > "Make your rules dynamic".

This is my data:

enter image description here

These are my rules:

{
  "rules": {
    "messages": {
      "$message": {
        ".read": true
      }
    }
  }
}

When I'm now trying to access them I get an error:

 Error: permission_denied: Client doesn't have permission to access the desired data.

My issue somehow has to be related to the "$message"-variable, because if I put ".read": true above "$message" it works.

Can anyone help me out on this please?

user3255061
  • 1,757
  • 1
  • 30
  • 50
  • See [http://stackoverflow.com/a/26531516/879295](http://stackoverflow.com/a/26531516/879295). Does that answer your question, or no? – Rob DiMarco Mar 06 '15 at 00:33
  • Thanks Rob for your answer. I was confused by the example in your docs, but I'm also pretty new to this. I'm still struggling to find a good data structure though. Basically I have companies and those companies have an admin and users. And I want to make sure that a company's admin can't edit users of other companies. You don't need to solve this of course, but is there any example you could recommend me? I've searched your docs but didn't find anything suitable. Sorry, I'm still a beginner. – user3255061 Mar 06 '15 at 01:27
  • So did the other stack overflow link Rob provided answer your question? Hint: it's the right answer. – Kato Mar 07 '15 at 06:22

0 Answers0