I am creating a voting app on Firebase. I have 3 types of users. So far i can successfully redirect 2 kinds of users (STUDENTS, TEACHERS) to their respective activities afte
you need another data-structure, with users and roles/admin, roles/teacher, roles/student and then check which node has the key (also compatible with security rules).
as you have it, you could simply remove the else branch and query all three nodes.