I have the following situation in my project. I'm using Angular Firestore to get a groupCollection of users detailed information.
My database collection hierarchy looks like this.
users/{userId}/personalInfo/{document}
I created a group index for personalInfo in Firestore.
When I reset my rules to default like putting
match /{document=**} {
allow read, write: if false;
}
at the end of my rules, it works and I am able to query every personalInfo document.
But as soon as I try to set any rule to protect this groupCollection I get this "permission denied" message.
The most simple rule I tried to set at bottom of my rules looks like that.
match /users/{userId=**}/personalInfo/{doc} {
allow read, write: if true;
}
But unfortunately, I get this permission denied message and don't know why.
Inside my UserService, I'm using Angular Firestore to simply execute the collectionGroup query.
constructor(private afs: AngularFirestore) {}
public getUsersDetailedInfo() {
return this.afs.collectionGroup('personalInfo');
}