Reputation: 11
I would like to explain my problem with an example ;There is a user having uid [let say: vluAZiiV3deiFaPq5KdzFI1Dsx73] should only be given access to a collection [let say: elephant] out of three collections elephant,tiger,cheetah.
I tried to write the following rule to best of my knowledge but It didn't work.
service cloud.firestore {
match /databases/{database}/documents {
match /elephant/{document=**} {
allow read, write: if request.auth.uid == AZiiV3deiFaPq5KdzFI1Dsx73
}
}}
Upvotes: 0
Views: 100
Reputation: 83103
You should declare the uid
value as string, with quotes, as follows:
service cloud.firestore {
match /databases/{database}/documents {
match /elephant/{document=**} {
allow read, write: if request.auth.uid == "AZiiV3deiFaPq5KdzFI1Dsx73"
}
}}
Upvotes: 1