I am using Firebase to authenticate my Flutter project with the firebase_auth package . You would need to create user roles.
For this I have read that it would be useful to use custom claims but I don't know how to use them in Flutter. The documentation only explains for other languages.
Another solution I had thought of is to create an "administrators" record in my database and add the uids there. However, if I could apply these roles directly from Firebase authentication it would help me manage read and write rules. How can I implement the roles with Fireabse?
From what I understand you can't use user roles in Firebase with Flutter. The solution that I have given is to save the IDs in the database and from there assign each one a role, as follows:
As an example, using 0 for common users, 1 for moderators and 2 for administrators.