As I am using Flexible Sync for my application, I have to define my rules on sync level and not on document level. However I was wondering how to achieve read and write permissions across collections as I only have access to the current document from within the rules.
In the documentation I found following snippet:
{
"defaultRoles": [
{
"name": "owner-write",
"applyWhen": {},
"read": {
"owner_id": {
"$in": "%%user.custom_data.subscribedTo"
}
},
"write": {
"owner_id": "%%user.id"
}
}
]
}
This kind of suggests, that I should write business logic into the custom user data (in this case subscribedTo). So I meant to ask if this is the recommended way to solve cross collection validation, as I feel very hesitant to put business logic into the user data just for the sake of document validation.