Reputation: 55
How can I determine the User that initiated one of my functions that I have created in my Server Methods Unit?
Upvotes: 0
Views: 1312
Reputation: 15538
Just use TDSSessionManager.GetThreadSession.Username
if you have authentication enabled.
Upvotes: 0
Reputation: 56
in the ServerContainerUnit or WebModuleUnit (ISAPI),
DSAuthenticationManager.onUserAuthenticate procedure or TDSServer.onConnect ect...,
use TDSSessionManager.GetThreadSession.PutData('UserName',User); identify current user to DSSession,
in your Servermethods unit functions, you can use TDSSessionManager.GetThreadSession.GetData('UserName')from the DSSession what you saved onUserAuthenticate or other procedure.
Tested on DataSnap REST ISAPI, work fine.
Upvotes: 1