Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to give different access to different type of user for login in Firebase?

I am creating an application on Android in which I am using Firebase as a database. I have three different kinds of users in that which are operators, managers, administrators to each one I want to give different kinds of access to every one of them like operator, manager can view and add data whereas admin can add/delete/view data. I tried using email & auth tab in Firebase but it doesn't allow me to set the type of user on it. I just require help on the aspect on how do I have different login types for different users.

like image 958
Kushagr Jolly Avatar asked Jun 19 '16 13:06

Kushagr Jolly


Video Answer


1 Answers

Firebase Authentication (as its name implies) just authenticates the user: it ensures the user is who they say they are. It has no ability to set a specific user type.

To restrict access for user based on their identity requires that you write rules for your database. See https://firebase.google.com/docs/database/security/

The model you're describing is known as role-based security ad has been covered before. After reading the documentation, I recommend searching for more information on that.

like image 89
Frank van Puffelen Avatar answered Sep 18 '22 18:09

Frank van Puffelen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!