I have a function called sys_function in realm which I want to call/execute/run as system user always, so I chose the “Script” Authentication method and put
exports = function(payload) {
return { "runAsSystemUser": true }
};
in the “Execute as a user chosen dynamically by calling a function” field (like adviced in this article: https://www.mongodb.com/docs/atlas/app-services/functions/ where it says
" The function must return a specific user’s
id
string or can specify a system user by returning{ "runAsSystemUser": true }
."
)
If I then call this function from another function by context.functions.execute(“sys_function”, <args…>), sys_function still runs as the same user that called the other function.
I looked all over the internet and MongoDB Forums and couldn’t find an answer. I need this to work. Thanks in advance!