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)
repair the Lacking or Inadequate Permissions Error
Possibility 1: Change guidelines (Advisable)
- 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;
}
}
}
Possibility 2: Override Authorization / Disable Safety
- Login to Firebase
- Go to
Database
->Guidelines
- Change
enable learn, write
fromfalse
totrue
[for dev] - Change
enable learn, write
fromfalse
torequest.auth != null
[for prod]