Hi. I’ve seen many filter based on user custom data and I could insert the field I want in there but I was wondering if I can use something in the identities array? I tried this:
{
"roles": [
{
"name": "owner-read-write",
"apply_when": {},
"document_filters": {
"read": { "createdBy": "%%user.identities[0].id" },
"write": { "createdBy": "%%user.identities[0].id" }
},
"read": true,
"write": true
}
]
}
But it doesn’t work (it works in functions) so I’m wondering if it’s just not possible.
Another thing I wanted to know is if I can do something like
{
"name": "owner-read-write",
"apply_when": {},
"document_filters": {
"read": {
"owner_id": {
"$in": "%%db.anotherCollection.user_ids"
}
},
"write": { "owner_id": "%%user.id" }
},
"read": true,
"write": true
}
or something similar?