I've been creating an app and I'm close to releasing it to the public, I just need to touch upon the security part, I'm trying to get my rules to only allow users who haven't signed up yet (non-authorized users) the permission to look at everyone's username and email in the database but nothing else that's in their UID area. Obviously, if the user that owns the data is logged in then he can look at all of his data. Here's what I got so far:
{
"rules": {
"users":{
"$uid":{
"email":{".read": "true"},
"username":{".read": "true"},
"matchUrls":{".read": "true", ".write": "true"},
"accountCreatedAt":{".read": "auth.uid === $uid"},
"lastSignedInAt":{".read": "auth.uid === $uid"},
"lastUsedApp":{".read": "auth.uid === $uid"},
"matchesPlayed":{".read": "auth.uid === $uid"},
"profileImageUrl":{".read": "auth.uid === $uid"}
}
}
Thanks, Nathan