• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How users can only see their own data in Cloud Firestore?

ibrmrt

Lurker
I'm building an app with Kotlin. In the app, the user can sign up and log in. After the user log in, the user adds some text and pictures, and these data is successfully added to the firebase cloud store and displayed in the app as a list. However, this list can be accessed by anyone registered on the app.

What I want to do is how users can only see their own data. So I don't want users to see each other's data. I just want every user to see their own added data. I think that I need to change Firebase Cloud Strore rules but How?.

I'm new about this, Thank you !

This is Cloud Firestore Rules;

Code:
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
   match/Notes/{noteId}{
   allow read, write: if request.auth.uid != null ;
  
       }
   }
}

and this is my cloud firestore ;


f1esi.png
 
Back
Top Bottom