Home > Software engineering >  Firestore Security Rules for specific user that was added in the Firebase console directly
Firestore Security Rules for specific user that was added in the Firebase console directly

Time:02-10

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

CodePudding user response:

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";
}
  • Related