JS3
JS3

Reputation: 1849

Firestore Security Rules for specific user that was added in the Firebase console directly

I have this user where I added it directly from the firebase console, hence, it is not in any user collection.

Is it possible that only this specific userID can access collections of orders and products?

enter image description here

Upvotes: 0

Views: 58

Answers (1)

Dharmaraj
Dharmaraj

Reputation: 50930

If it's only one user then you can restrict read access of those collections to that specific UID using the following rule:

match /orders/{orderId} {
  allow read: if request.auth.uid == "firebase_user_id";
}

Upvotes: 2

Related Questions