# Link firebase data to user (groups)

**URL:** https://community.thunkable.com/t/link-firebase-data-to-user-groups/1231688
**Category:** Questions about Thunkable X
**Created:** [April 18, 2021, 5:10pm UTC](https://community.thunkable.com/t/link-firebase-data-to-user-groups/1231688 "2021-04-18T17:10:28Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![zq6thajhra8qv7cc](https://avatars.discourse-cdn.com/v4/letter/z/f1d935/32.png) [@zq6thajhra8qv7cc](https://community.thunkable.com/u/zq6thajhra8qv7cc)
#### Post date: [April 18, 2021, 5:10pm UTC](https://community.thunkable.com/t/link-firebase-data-to-user-groups/1231688/1 "2021-04-18T17:10:28Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)
#### Post date: [April 18, 2021, 6:23pm UTC](https://community.thunkable.com/t/link-firebase-data-to-user-groups/1231688/2 "2021-04-18T18:23:48Z")

</div>

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](https://medium.com/@juliomacr/10-firebase-realtime-database-rule-templates-d4894a118a98)

---

<div class="post-metadata">

### Author: ![zq6thajhra8qv7cc](https://avatars.discourse-cdn.com/v4/letter/z/f1d935/32.png) [@zq6thajhra8qv7cc](https://community.thunkable.com/u/zq6thajhra8qv7cc)
#### Post date: [April 21, 2021, 12:29pm UTC](https://community.thunkable.com/t/link-firebase-data-to-user-groups/1231688/3 "2021-04-21T12:29:34Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)
#### Post date: [April 21, 2021, 2:01pm UTC](https://community.thunkable.com/t/link-firebase-data-to-user-groups/1231688/4 "2021-04-21T14:01:04Z")

</div>

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](https://medium.com/firebase-developers/patterns-for-security-with-firebase-group-based-permissions-for-cloud-firestore-72859cdec8f6)

---

<div class="post-metadata">

### Author: ![zq6thajhra8qv7cc](https://avatars.discourse-cdn.com/v4/letter/z/f1d935/32.png) [@zq6thajhra8qv7cc](https://community.thunkable.com/u/zq6thajhra8qv7cc)
#### Post date: [April 21, 2021, 2:05pm UTC](https://community.thunkable.com/t/link-firebase-data-to-user-groups/1231688/5 "2021-04-21T14:05:32Z")

</div>

Great!

Thanks, Muneer!

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 8, 2024, 1:25pm UTC](https://community.thunkable.com/t/link-firebase-data-to-user-groups/1231688/6 "2024-11-08T13:25:07Z")

</div>


