User Management from Perspective Client Session

You can use system.user.editUser, just use system.security.getUsername to get the currently logged in user. The docs have an example that should tell you everything you need to know about the scripting aspect.

https://docs.inductiveautomation.com/display/DOC81/system.user.editUser
https://docs.inductiveautomation.com/display/DOC81/system.security.getUsername

Edit: There’s also a session property that has the username: auth.user.userName