I'm trying to learn Firebase Rules so I can set up a web app where users can create groups. Only the users that created the groups (or have access to them) should be able to see them if they are set up to be Private.
I've been banging my head against the wall reading the available tutorials but I can't seem to find anything that even supports what I'm attempting.
Maybe I'm looking at it the wrong way, or even may need a different kind of Data Structure to achieve this.
Anyway, my data structure is as follows:
And the rules I'm attempting to use to achieve it:
I'm using Simple Login to SignUp and Authenticate new/existing users.
Could I please get some help on this ? Thanks.
EDIT
I've changed my data structure a bit, and managed to restrict READ to a certain user when trying to READ a certain group.
However, I'm still not getting the desired result. Using Angular, when I get the groups
object referencing root/groups
from firebase, I don't get any matches, and it returns empty.
I expected the following:
- Getting the
RlyNew
group when logged in asuser@user.com
; - Getting no groups when logged in as
admin@admin.com
Is this even possible ?