FirebaseError: [code=permission-denied]: Missing or insufficient permissions
Try changing the rule to:
match /itinerary/{userId}/itineraryList/{doc} {
allow read, write: if true;
}
Be aware, the if condition of 'true' is just for testing, as it allows everyone permission to that resource. I only suggest it here for to test the rule works.
Adding /{doc}
to the match - allows the rule to be applied to the documents you are protecting.
add this to your Database Rules tab :
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write;
}
}
}
I solved this by changing the rules of the database to the reading allowed for anyone, but leaving the methods of creating, changing, deleting and updating only for connected users. The commented part is for a later implementation where you have already defined administrator rules for each user logged in, so you can pass there that only users who are administrators can change.
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read: if true;
allow create, update, delete, write: if request.auth != null;
//allow create, update, delete, write: if request.auth != null && request.auth.uid == userIdAdmin;
}
}
}