I can not write data to my firebase

-1
Error: Uncaught (in promise): Error: PERMISSION_DENIED: Permission denied
Error: PERMISSION_DENIED: Permission denied

My firebase configuration looks like this:

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if 'true';
    }
  }
}

Before it was like this in the original configuration:

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write;
     }
   }
 }
    
asked by anonymous 27.08.2018 / 18:56

2 answers

0

It turns out that you are changing the data in the wrong place.

In Firebase there is a new option called Cloud Firestore , which is selected by default (see image below), but / strong> and yes in Realtime Database

WhenyouselecttheRealtimeDataBase>Rulesoption,changethesettingstothefollowing:

{"rules": 
{
    ".read": true,
    ".write": true
  }
}

    
28.08.2018 / 02:12
0

At a glance here ... The firebase site has a great documentation, read it carefully that you will be able to do what you want.

According to this link you have to do so

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if true;
    }
  }
}

Without the quotation marks you put in if 'true';

And from what I understand you want to release the access for all, then in this case leave as it already comes by default

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write;
    }
  }
}
    
27.08.2018 / 19:09