Can guest update other user profile on console?

Hi,

I play with Python API by “bench console”, then done as following:
changing the session user to Guest, and successfully change other user profile.
Is this correct?

Hi @raeuz,

the console assumes that you are the Administrator once you log in from the console (no guest should ever get to the console). The frappe session is used for a web session… So here you are changing the value as Administrator.

Hello @lasalesi ,

Can switch to other user for debug on console? e.g. switch to Guest or another one.

@raeuz in theory frappe.set_user should impersonate (swap) users even into the console, if it’s not happening maybe it’s an bug?!

Hi @max_morais_dmm,

I am not sure that. I was just looking for how to swap user for debug and found this issue.

The version of bench i run is 5.1.0

(py38) raeuz@raeuz:/media/raeuz/home/raeuz/workspace/web/bench/erpnext$ bench --version
5.1.0
(py38) raeuz@raeuz:/media/raeuz/home/raeuz/workspace/web/bench/erpnext$ 

if you want to update the user profile so by default session is Administrator so you can do with that too

Hi @khushal_t,

My goal is to swap different accounts with different permissions for debug.
Can you tell me how to do it?