Get logged user information in custom node

Hi @chiche

it depends what exactly you are trying to do in myNode.js.

A node deployed in the runtime has no knowledge of the editor or any concept of users.

The only place you may have code in myNode.js that cares about editor users is if you have created a custom admin HTTP endpoint that gets called by the editor as part of your node's edit dialog.

In that context, as long as you include the RED.auth.needsPermission middleware, the req.user property should tell you who the user is calling the end point.

RED.httpAdmin.get("my-custom-node/do-something", RED.auth.needsPermission('XYZ.read'), function(req, res) {
   // req.user should identify the user.
});