How to store data based on role levels using firebase and react

41 views
Skip to first unread message

Akshay

unread,
Mar 22, 2019, 7:52:05 PM3/22/19
to Firebase Google Group

I am currently working on my final year project using react and firebase,

I have been working with firebase and been able to store the data directly,

but now I want to give role-based access to the users.

2.png



This is the  hierarchy  of users to store all data which is received and topmost level user i.e **principal can read and write all the data ( principal, vice principal, hod, faculties) branches**, lower level user i.e **vice-principal should not be able to read and write the data(fields in particular) associated with principal but can read and write the data associated with(vice principal, hod, faculties)** branches. and so on.....

to be more clear 

1.png



I would appreciate any help. Thanks in advance.

jo...@nowims.com

unread,
Mar 27, 2019, 10:35:36 AM3/27/19
to Firebase Google Group
I would recommend using Firestore over the Real-time database for your project... 

Here is a link that should help you - https://firebase.google.com/docs/firestore/solutions/role-based-access#solution_role-based_access_control 
Reply all
Reply to author
Forward
0 new messages