Impersonate user in cloud Function(s)

Quick question,

We need to perform queries as a user (that respect ACL) inside a Cloud Function.

How do we do this ?

I tried:

  await Parse.User.become(request.user.getSessionToken())

But it throws an exception Uncaught (in promise) Error: It is not memory-safe to become a user in a server environment

To perform the query as a different user you can use the sessions token to query:

(new  Parse.Query(Parse.Installation).find({sessionToken: request.user.getSessionToken()})

Will give you only the Installation-Instances this user has the ACL to access.