The Database have a collection "Collection" and each document inside the collection have an object "members" which contains the "uid" of users who will have access to the document.
Collection--->document-->members = {"BZntnJO2PVS8OZ9wctwHiyxBytc2": true}
I have tried many different types of rules but none of these rules seems to work
service cloud.firestore {
match /databases/{database}/documents {
match /collection/{documentId} {
allow read: ****
}
}
1)
allow read: if get(/databases/$(database)/documents/collection/$(documentId)).members[request.auth.uid] != null
2)
allow read: if resource.data.members[request.auth.uid] != null
3)
allow read: resource.members[request.auth.uid] != null
4)
allow read: if request.resource.data.members[request.auth.uid] != null
5)
allow read: request.resource.members[request.auth.uid] != null
Can it be a Firestore bug?