Uncaught (in promise) FirebaseError: The caller does not have permission at new e

Viewed 693

I use React and I wanna add data to Firestore.

Usually everything works fine but now I got a problem which I mentioned above. I didn't change my Firestore rules before, so it's very strange that I suddenly got a problem. After some hours of research I changed my rules, but it still doesn't work.

It's the first time I'm using react-router.. what does this have to do?



prebuilt-47338342-439a2133.js:188 Uncaught (in promise) FirebaseError: The caller does not have permission
    at new e 


 function e(
    /**
     * The backend error code associated with this error.
     */
    e, 
    /**
     * A custom error description.
     */
    n) {
        var r = this;
        return (r = t.call(this, n) || this).code = e, r.message = n, 
        /** The custom name for all FirestoreErrors. */
        r.name = "FirebaseError", 
        // HACK: We write a toString property directly because Error is not a real
        // class and so inheritance does not work correctly. We could alternatively
        // do the same "back-door inheritance" trick that FirebaseError does.
        r.toString = function() {
            return r.name + ": [code=" + r.code + "]: " + r.message;
        }, r;
    }
    return w(e, t), e;
}(Error), N = new c("@firebase/firestore");

/** An error returned by a Firestore operation. */
// Helper methods are needed because variables can't be exported as read/write
function D() {
    return N.logLevel;
}



1 Answers

Posting the @MightyMike's solution as a Community wiki for better visibility.

The error was fixed after creating a new Project with the following security rules:

rules_version = '2';
service cloud.firestore { 
 match /databases/{database}/documents { match /{document=**} { 
  allow read, write: if request.time < timestamp.date(2021, 7, 23); } 
  } 
 }
Related