whatwhatwhat
whatwhatwhat

Reputation: 2256

Can a Firestore security rule enforce based on a collection name?

So far in developing my app, I've set it up so that users have their own collections for some important things. The catch is that I've named them using their UID.

For example, everyone has a friends list, so for particular user UID123, her friends collection would be called friends_UID123. I'm now trying to set up a security rule to make it so that only an authenticated user where their UID = UID123 can read/modify this collection. How do I set up a rule so that it compares the request's UID to the UID in the collection name?

Update: Based on a comment below, it seems like this might not be possible right now. Maybe in the future though?

Upvotes: 0

Views: 90

Answers (1)

Roopa M
Roopa M

Reputation: 3009

I believe it is not possible to match on a partial collection name. You can consider raising feature request as suggested in this thread

You can give a try to workaround mention in the above thread

Upvotes: 1

Related Questions