User object functions

I’m trying to use the system.user.editUser function, but according to the documentation (https://docs.inductiveautomation.com/display/DOC80/system.user.editUser) I need to edit the user object with methods that don’t seem to be documented at all. It references one method addContactInfo(), but then I can’t find anything else in the documentation. Can anyone tell me how I find the method list for editing the user object? I would like to change the roles.

The user object should be an instance of the BasicUser class.

This is what I was looking for thank you. But obviously I am searching in the wrong place, because if I look for BasicUser in the Ignition user manual online, it doesn’t find anything. Where should I be entering my searches to find this kind of documentation?

Unfortunately, at some level (and it’s easy to do, so there’s no real way to tell you exactly when it will be) you “break out” of the expected areas where we’ve documented things and end up in the base Java classes that we’re using internally. Jython automatically wraps these up so they mostly seem like Python objects, so it’s hard to tell exactly when you get there.

What I generally recommend, if you’re encountering something unfamiliar and want to see what you can do with it:

  1. Start with runtime inspection. Python’s builtin dir() function is already pretty powerful, and you can supercharge it with @pturmel’s excellent introspect module:
    Finding all available methods from a component
  2. If that fails, try seeing what the class of the object is, via type(<object>), then take that and search for it in the Javadocs for your version, linked from the “SDK programmer’s guide”, on the right hand side.
4 Likes

You can also retrieve a User object by the system.user.getUser() function documented here, it has the additional methods you can use with it also. https://docs.inductiveautomation.com/display/DOC80/system.user.getUser

Yes, but it doesn’t describe any methods to change pieces of the object like the role. @PGriffith was correct in what I was looking for.