Firebase Auth, Firestore & Storage (plugin)
  • 🚀Getting Started
  • Setup
    • Create a Firebase Project
    • Get Firebase access credentials
    • Offline Support
    • Secure your credentials and data
      • Restrict your api-key to your domain
      • Security Rules on Firebase
  • Plugin Elements
    • 🛠️About elements
    • 💾Data Schemas
    • Firebase Auth (Current User)
    • Firestore Data List
      • Firebase Geohash
      • Firestore Data (legacy)
    • Firestore Data Extractor
    • Firestore Data Single
    • Firestore Data Aggregation
    • Firestore Data Processor
    • Firebase Storage Upload Button
    • Firebase Action Listener
    • Firebase Dropdown Processor
  • Plugin Front-end Actions
    • 💻About front-end actions
    • 💾Field types table
    • Firestore
      • Create a new document
      • Update a document
      • Delete a document
      • Update a list of documents
      • Delete a list of documents
      • Batch Operations
        • Batch Operation Constructor
        • Batch Operation Commit
    • Firebase Auth
      • Sign the User Up
      • Log the User In
      • Log the User In with Google
      • Log the User In with Facebook
      • Log the User In with GitHub
      • Log the User Out
      • Update User's Profile
      • Update User's Password
      • Update User's Email
      • Send password reset email
        • Handle reset password code
      • Send verification email
        • Handle verify email code
      • Delete current user
    • Firebase Storage
      • Upload file base64
      • Delete uploaded file
  • Plugin Back-end Actions
    • ☁️About backend actions
    • Firestore Backend
      • Get a list of documents
      • Get a single document
      • Count a list of documents
      • Create a new document
      • Update a document
      • Delete a document
      • Update a list of documents
      • Delete a list of documents
    • Firebase Auth Backend
      • Create an account for someone else
      • Update another user's profile info
      • Delete a user account
      • Generate email confirmation link
      • Generate password reset link
      • Set user roles
Powered by GitBook
On this page
  • Inputs and Settings
  • User ID
  • User Roles (1, 2, 3 and 4)
  • Returned Values
  1. Plugin Back-end Actions
  2. Firebase Auth Backend

Set user roles

PreviousGenerate password reset link

Last updated 11 months ago

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.


Inputs and Settings

User ID

The ID of the user you want to add tokens to.

User Roles (1, 2, 3 and 4)

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.


Returned Values

This action returns no values, as the update operation on firebase-admin returns no information about the updated document.