Set user roles
Last updated
Last updated
For the use of Firestore Security Rules, sometimes it's useful to store "tokens" on user's, that allow to identify them as an specify role.
For instance, you might want to define a user as an admin, so that they can access data that other user's cannot.
This action allows to add tokens to user's, in order to associate them to specific roles. This is kind of storing additional data to the user, not on Firestore, but on the Firebase Authentication service itself.
The ID of the user you want to add tokens to.
Text fields in which you can store the roles you want the user to have.
They will always be linked to the the specify tokens: user_role1, user_role2, user_role3 and user_role4. You van use this values on security rules to add specific access to certain document.
This action returns no values, as the update operation on firebase-admin returns no information about the updated document.