How to redirect multiple types of users to their respective Activities?

前端 未结 2 676
萌比男神i
萌比男神i 2020-11-22 11:43

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

2条回答
  •  遥遥无期
    2020-11-22 12:25

    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.

提交回复
热议问题