User aware functions server side


#1

hey guys,

In methods I can call the userId functions, so I know which user is calling the method. But wha if my method A calls function B server also server side? Does this function also has access to the userId or do I have to supply this via a parameter (e.g. generationUserId)?

example:
export function publishApp(appGuid, appName, streamId, customerName, generationUserId)

thanks


#2

You’ll need to pass the userId unless you bind the function’s context to the method’s context (using bind, call or apply).


#3

thanks! yeah, maybe is passing the parameter then easier to follow for other developers. Great, then I am going the correct path…


#4

Simply try it and see for yourself :wink: