Hello,
We are currently working on a project with multiple user types and want to apply rules to our collections to ensure correct access.
While writing the rules we encountered an issue. Rules that contain more than one statement in the apply_when are just not working and just throwing exceptions in backend:
error executing match expression: invalid document: must either be a boolean expression or a literal document
The rule is:
"apply_when": {
"company": "%%user.custom_data.company",
"%%user.custom_data.type": "supplier"
}
(With “company” being a field in the document and “supplier” beeing a possible value of the type in the custom data)
Both statements of the apply_when are working solo in other places. But when together - they result into the exception.
Are we missing something? Because in the documentation this is presented as the way to go for multiple statements.
Best Regards,
Daniel