In python Webapp pass global variable of person logged in and interacting with the app
Hi Everyone,
I did look through existing discussions and I have not see exactly the answer I'm looking for. Either in a python notebook, and by extension a python Webapp, I would like to grab the DSS user id that is currently logged in and interacting with the webapp in a variable.
My use case, is I created a webapp where someone can interact with a row of data from an existing table, and I want to pass their user id as a variable into a column in the psycopg insert statement so when I add a record of the row in a new table, I have a record of who did it.
Any help appreciated!!!
Thanks,
Jordan
Best Answers
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,160 Neuron
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,160 Neuron
That's correct associatedDSSUser is the Run As user and userForImpersonation is the logged web user. You must have the WebApp set to Run backend as = Last modifier. This is not ideal and you probably want to have a separate generic account to run WebApps.
Answers
-
Hi @Turribeach
,Awesome, thank you https://doc.dataiku.com/dss/latest/webapps/security.html explained it perfectly. Do you know the difference between 'associatedDSSUser' and 'userForImpersonation'. I see my userID in both. Which one would be the person logged in and interacting with the web-app? I see the documentation further talks about impersonating a user, so I'm assuming associatedDSSUser is the one logged in but just checking.
Thanks!
Jordan