I do not know if I understood your doubt well, however, as described in the documentation:
https://firebase.google.com/docs/database/security/quickstart?hl=pt-br
Database rules require Firebase Authentication and
grant read and write permissions to users only
authenticated. Standard rules ensure that the database is not
accessed by anyone before being set up. 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 defining these rules, it is possible to configure the level of access of each user to the data, in this same documentation link, there is a deeper explanation about defining these rules for users.