I do not know if I understood your question well, but, as described in the documentation:
link
Database rules require Firebase Authentication and
grant read and write permissions to users only
authenticated. The default rules ensure that the database is not
accessed by anyone before being configured. Then customize them
according to your needs. Check out some common examples:
// These rules don't allow anyone read or write access to your database
{
"rules": {
".read": false,
".write": false
}
}
Therefore, by setting these rules, you can configure each user's level of access to the data, documentation link , there is a more in-depth explanation of how to define these rules for users.