Roles are stored as Firebase Auth custom claims, not Firestore documents.
Use this page to assign roles by calling the assignRole Cloud Function.
realtime-7fc82admin@demo.com).After creating users, note their UIDs from the Authentication → Users list.
You must be signed in as an admin to call the
assignRole Cloud Function. The first admin must be bootstrapped
using the Firebase CLI (see note below).
node functions/bootstrap-admin.js <uid>
Roles are set as custom claims on the Firebase Auth token.
Valid roles: admin, user.
admin = full edit, user = limited edit, public viewers = read-only without login.
After assigning a role:
getIdToken(true)) to receive the updated token with the new claim.{"role":"admin"} or {"role":"user"}.request.auth.token.role and in client code via getIdTokenResult().