I want to build a chat app where chatroom admins can manage multiple rooms and the admin privileges are granted based on which groups they are in. Most of the domain data is in another db and I want to keep it there. When I created the token I did:
var token = tokenGenerator.createToken({ uid: "uniqueId1", groupIDs:[1,2,3] });
In the security rules I want to get something like if the auth object has groupID 2 or not. If yes then the admin can access the room. But I couldn't figure out how I can iterate though the groupIDs in the firebase security rules using auth.groupIDs
.
I can probably go with var token = tokenGenerator.createToken({ uid: "uniqueId1", 1:true, 2:true, 5:true });
instead of array. But still because the object keys are dynamic I don't know how to access them in the security rules. Any suggestions?
Thanks!