I want to have group based access to data in firebase. The issue I'm having is figuring out how to structure the data so that multiple groups can have access to the same data and allow users to belong to several different groups.
Asked
Active
Viewed 969 times
2
-
possible duplicate of [Firebase: set security rules depending on user roles](http://stackoverflow.com/questions/25641184/firebase-set-security-rules-depending-on-user-roles) – Kato Oct 27 '14 at 18:08
-
Also: http://stackoverflow.com/questions/26487204/member-based-security – Kato Oct 27 '14 at 18:10
-
Also: http://stackoverflow.com/questions/19520615/how-do-i-implement-role-based-access-control-in-firebase – Kato Oct 27 '14 at 18:10
1 Answers
0
Here's an idea of how you could do it: https://i.stack.imgur.com/yVfqV.jpg
I would suggest the following Firebase rules:
{
"rules": {
"stackExample": {
"groupData": {
"$groupName": {
".read": "root.child('stackExample/Accounts/' + auth.uid + '/groups/' + $groupName).val() == 'true'"
}
}
}
}
}
This was just a quick mockup, hopefully it gives you an idea! :)
//S

Samuel Norling
- 56
- 4