Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase - Missing or insufficient permissions

I'm using Firestore for my project and it seems to have some collection reference error.

ERROR FirebaseError: Missing or insufficient permissions. at new FirestoreError (localhost:4200/vendor.js:66703:28)

Iv' used Angular Firebase in the past and it seems like I'm doing the same thing as I did last time.

my query is very simple and its looks like that

public getUsers(): Observable<any> {
    return this.afs.collection('users').valueChanges();
  }

I didnt make any changes for the Database rules

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

Do you have any idea why is that keep hapening?

like image 699
Matan Shushan Avatar asked Dec 13 '22 11:12

Matan Shushan


1 Answers

You could change 'false' to 'true'. It will allow read/write access to all users under any conditions but NEVER use this rule set in production; it allows anyone to overwrite your entire database.

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if true;
    }
  }
}
like image 180
Xilbreks Avatar answered Feb 10 '23 11:02

Xilbreks