firebase-jekyll-comments icon indicating copy to clipboard operation
firebase-jekyll-comments copied to clipboard

firebase rules throwing permission denied errors

Open nealrs opened this issue 11 years ago • 4 comments

For some reason, the supplied security rules keep throwing permission denied errors whenever i try to push data to fb. I ended up using this as a stopgap:

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

It's not perfect, but it's simple & at minimum, you need to have a token. I tried all of the following:

".write": "auth != null && (!data.exists() || !newData.exists())"
".write": "auth != null && !data.exists()"
".write": "auth != null && !newData.exists()"

but they each throw the same error in my browser console:

FIREBASE WARNING: set at /users/twitter:1643903942 failed: permission_denied  firebase.js:35

nealrs avatar Sep 19 '14 01:09 nealrs

Did you figure this out?

dominictobias avatar May 02 '16 22:05 dominictobias

Nope. Still using the above hack

nealrs avatar May 02 '16 22:05 nealrs

I assume you meant:

".write": "auth != null && newData.exists()"

if you're pushing data, obviously new data must exist. The other ones would only work if the db was empty

samvictor avatar Jun 29 '18 23:06 samvictor

Change the rules to ".read": true, ".write": true

worked for me.

consbulaquena avatar Jul 02 '18 16:07 consbulaquena