Not sure why I'm getting this error while accessing AngularFirestoreCollection:
ERROR Error: Missing or insufficient permissions.
this.categories = afs.collection('categories').doc(this.afAuth.auth.currentUser.uid).collection<Category>('categories');
Firestore Database Rules:
service cloud.firestore {
match /databases/{database}/documents {
match /categories/{userId}{
allow read, write: if request.auth.uid == userId;
}
}
}
What am I missing here?
/categories/{userId}/categories, yet your rule is only for/categories/{userId}. Try changing it tomatch /categories/{category=**} {. - Joseph Webber