17

I cannot find an answer to this in the documentation. The default Firebase rules are:

{
  "rules": {
    ".read": "auth != null",
    ".write": "auth != null"
   }
}

I have edited mine to look like this and saved them:

{
  "rules": {
    "users":{
      ".read": true,
        ".write": "auth != null"
    },
    ".read": "auth != null",
    ".write": "auth != null"
  }
}

Without me doing anything, they randomly reset to the old rules after what seems like 12 hours. Am I missing some kind of persist option here?

AL.
  • 36,815
  • 10
  • 142
  • 281
cheenbabes
  • 382
  • 1
  • 8
  • 17
  • No, once you've published them using the management console, they should not reset. – cartant Jan 17 '17 at 21:13
  • 1
    Any idea why this is happening? Should I be contacting support? I am just on the free Spark level. – cheenbabes Jan 17 '17 at 21:18
  • No idea why. If you want to experiment, create another project and see if the same happens. If so, perhaps lodge it as a bug. – cartant Jan 17 '17 at 21:21
  • 14
    It seems most likely that you're deploying a firebase-rules.json as part of running `firebase deploy` with the Firebase Tools. See [this question](http://stackoverflow.com/questions/38276547/how-do-i-deploy-firebase-database-security-rules-using-the-command-line). I thought there was also a more recent question about it, but I can't find it right now. – Frank van Puffelen Jan 17 '17 at 21:31
  • 1
    @FrankvanPuffelen Yep, that was it. I see it in my firebase.json now. – cheenbabes Jan 17 '17 at 21:33

1 Answers1

22

Adding this from the comments so others don't miss it.

It seems most likely that you're deploying a firebase-rules.json as part of running firebase deploy with the Firebase Tools. See this question. I thought there was also a more recent question about it, but I can't find it right now

Erich
  • 2,743
  • 1
  • 24
  • 28