I am trying to filter data from a document in firestore based on a role of a user. Let's consider I have a document named Company which contains data like a name and billing information. I have a user with the role Employee and he should be able to access the name of the Company but not the billing information. A user with the role Admin should be able to see the entire data.
Company Document in collection:
companyId123: {
name: "Awesome Company",
creditCard: "12345678"
}
Roles: Different access levels for admins and employees.
Is there anyway to adjust the data available to users based on their roles? What are the best practices?