Effective way of assigning roles using Firebase Auth emails/Password

Hey all,

I know I will be kicking myself after asking this but time is putting me under pressure for a solution.

Would anyone know the best solution/steps for asigning roles to users in Firebase Auth.

I see that asinging a specific displayName & hide/show based on displayName seems to be the best option.

Whats the best way to do this? Or is there a better way?


i think the best way is this
first create a new collection named users
add what you want on it and a field called role

then when creating a user in sign up page also create a record in the users collection with the same userid(search here in the forum there is a tutorial)

then create 2 app variables in your app called userid and role

then in your home page in the flow function section use the get current user component to get the userid then set the app variable userid to it

then go to data variables and add a new data variable of users with a single record with the id is the app variable user id

now you get the user record and you have the role in it

set the app variable role to the role from the record

now cou can control the visibility of your components with this app variable and the if condition

i wish this helps
good luck

1 Like

Thanks Raouf,

Worked perfectly.


1 Like