Hi,
I’m trying to combine the logging function as declared here: Logging Function, with a predicate check on write for a collection.
As a base case, the predicate of:
Lambda(["oldData", "newData"], true)
works fine, and all write operations are allowed.
When I change this to:
Lambda(["oldData", "newData"], Call("log", { message: "hello", value: true }))
to attempt to log a basic message and return a true
value to allow the write, neither the log document is created nor the action allowed, resulting in a
{
"errors": [
{
"message": "Permission denied"
}
]
}
on the graphql request.
I should also add that running the log
UDF from the shell performs as expected, and the log document is created, as well as true
being returned:
> Call('log', {message: 'hello', value: true})
true
I’ve given the role in question the permissions to access the function, as well as to write to the log
collection. Am I missing some other permissions? Are UDFs allowed in predicate calls?
Thanks!