I am using email/password authentication via Firebase, so currently I only have authenticated user and non-authenticated user. But for the app, I would like to have admin, moderator, user and guest four different kinds of role.
I did some research, but could not find any existing example or logic to do so. Here are my initial thoughs, but not sure if it is feasible. Basically two steps:
- Create a table in firebase called User, while Firebase record the email/password, I also push the data(email/password), and role information to the table.
- In the route, check if the user has the appropriate role to access the certain page
Any other better way to do it? Any idea would be appreciated!