Disable querying collection in Firebase Cloud Firestore with rules

后端 未结 2 451
野的像风
野的像风 2021-01-04 01:25

I am using Firebase Cloud Firestore, and I want to modify my rules to restrict users from querying a collection.

This should not be allowed:

firesto         


        
2条回答
  •  攒了一身酷
    2021-01-04 01:57

    Give the following a try. I haven't been able to test it, so apologies if I've mistyped something.

    match /users/{userId} {
        allow read: if $(request.auth.uid) == $(userId);
    }
    

提交回复
热议问题