Function execution security criteria

I know that for functions that are executed as an action, I can control who can execute it through security and submission criteria. I am wondering what security measures apply to general functions or functions on objects that are not setup as an action. In particular:

  1. For a pure utility function that does not interact with any ontology/objects (e.g. calculate tomorrow’s date), can anyone execute it? Is there any access requirement, for example the user executing the function needs to have read access to the code repo defining the function or alike?

  2. For function on objects, does the function execution check if the user executing the function has read access to object instances used in the function?

Documentation around the permissions required during execution can be found here.

Specifically to your first question (addressing specifically published Functions):

In order to execute a Function, a user must have Viewer role on the repository from which the Function was published.

And to your second question (addressing specifically published Functions again):

When a Function loads object data, either as a parameter or via an Object search, the permissions of the end user running the Function determine which objects are loaded. In the case of object types secured using row-level permissions, this means that different users executing the same Function may receive different results. This behavior is intended—users should only see the objects they have access to, and this behavior enables a single Function to work for users with differing access to individual objects.