Utilizing Firebase and get the next error within the console?
Uncaught Error in onSnapshot: FirebaseError: Lacking or inadequate permissions.<br>at new FirestoreError (index.cjs.js:x)
How you can repair the Lacking or Inadequate Permissions Error
Choice 1: Change guidelines (Really useful)
- Login to Firebase
- Go to
Database->Guidelines
Change:
service cloud.firestore {
match /databases/{database}/paperwork {
match /{doc=**} {
enable learn, write: if false;
}
}
}
to:
service cloud.firestore {
match /databases/{database}/paperwork {
match /{doc=**} {
enable learn, write: if request.auth != null;
}
}
}
Choice 2: Override Authorization / Disable Safety
- Login to Firebase
- Go to
Database->Guidelines - Change
enable learn, writefromfalsetotrue[for dev] - Change
enable learn, writefromfalsetorequest.auth != null[for prod]