Hi,
I was wondering if $and
operator is allowed in permissions JSON. Something like this:
{
"name": "owner-write",
"applyWhen": {},
"read": {
"_partitionKey": "PUBLIC"
},
"write": {
"$and": [
{
"_partitionKey": "%%user.id"
},
{
"organizationID": "%%user.custom_data.organizationID"
}
]
}
}
And this is the client side query:
QuerySubscription<Product>(name: "productsList") { $0._partitionKey == user._id && $0.organizationID == organizationID }
I am trying to add a record using this approach but the server reverts it.
Or maybe there is a better solution for my use case.
Thank you!