Here's an example of a rule that gives each authenticated user a personal node at /users/$user_id
where $user_id is the ID of the user obtained through Authentication.
// These rules grant access to a node matching the authenticated
// user's ID from the Firebase auth token
{
"rules": {
"users": {
"$user_id": {
".read": "$user_id === auth.uid",
".write": "$user_id === auth.uid"
}
}
}
}