my sample document like this:
{
"type": "group",
"members": [
"user2",
"user3",
"user4"
],
"owner": "user1"
}
I want to control as following:
- only
doc.owner
can modifydoc.members
property; - that every modified user in the
doc.members
mush has a channel namedfriends-of-user1
notice: I have assign suitable user tofriends-of-user1
channel before I modify the document.
for the first condition, I can use requireUser(doc.owner)
to control;
but for the second condition,how should I validate user’s channel? or any other suggestion for control users in the arrays that should have some channel?