Link firebase data to user (groups)

I have a students who wants to link firebase data to users (and user groups). So you only see the data selected by the user group but you should be able to select / add from the whole database.

I do not really know how to approach this and have not found material for that problem.

And ideas would be highly appreciated. Thanks in advance!

2 Likes

This is not a Thunkable issue per say but rather a database rule that you have to follow and implement in the database.

See this example. 10 Firebase Realtime Database Rule Templates | by Julio Marín | Medium

1 Like

Thank you for the link, Muneer!
So, we can set it up such that each user can only change his/her data.

What about the user groups? The users in that group should be able to edit their data.
And there should be a view where only their data is visible (in addition to another one where they can select data sets from the whole database).

Thanks again!

1 Like

You can of course do the same for groups.

https://medium.com/firebase-developers/patterns-for-security-with-firebase-group-based-permissions-for-cloud-firestore-72859cdec8f6

1 Like

Great!

Thanks, Muneer!

1 Like