Search

User Manual

GETTING STARTED


MODULES AND PLATFORM


APPENDIX


TUTORIALS & HELPFUL TRICKS


STRATEGIC PARTNER LINKS

Sepasoft - MES Modules
Cirrus Link - MQTT Modules

RESOURCES

Inductive University
Ignition Demo Project
Knowledge Base Articles
Forum
IA Support
SDK Documentation
SDK Examples

ALL USER MANUAL VERSIONS

Ignition 8.1
Ignition 7.9
Ignition 7.8

Deprecated Pages

Employees

Sign In

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Scripting_function



Panel
titleDescription

Looks up a specific user in a user source, by username. The full User object is returned except for the user's password.


Panel
titleClient Permission Restrictions

This scripting function has no Client Permission restrictions.


Panel
titleSyntax

system.user.getUser(userSource, username)

  • Parameters

String userSource - The name of the user source to search for the user in. Can be a blank string to use the Vision Client's default user source.

String username - The username of the user to search for.

  • Returns

User - The user, as a User object.   Refer also to the PyUser class.

  • Scope

Gateway, Vision Client, Perspective Session



Panel
titleUser Object

The "User" object that is returned contains all of the information about that user, except for the user's password. You can access most of the basic user properties via a call to "get" or "getOrDefault" which returns a default value if the requested item is not present. For example:

user.getOrDefault('schedule')

...will return that user's schedule, or the value of "Always" if no schedule has been set as that is the default schedule. The following are the various values you may use in this manner:

  • username
  • firstname
  • lastname
  • notes
  • schedule
  • language

In addition to these properties, the user object has other methods on it to retrieve more information:

  • user.getId() - returns the internal identifier object that the backing user source needs to identify this user
  • user.getRoles() - returns a sequence of strings representing the roles that this user belongs to
  • user.getContactInfo() - returns a sequence of ContactInfo objects. Each of these objects will have a contactType and a value property representing the contact information. Both properties are strings.
  • user.getScheduleAdjustments() - returns a sequence of ScheduleAdjustment objects. Each of these objects will have two date properties, "start" and "end", a boolean property, "available", and a string property called "note".
  • user.getPath() - returns a QualifiedPath object that represents this user in a deterministic manner.



Panel
titleCode Examples


Code Block
languagepy
titleCode Snippet
# This example will print the first and last name of the current user using the default datasource:
userName = system.security.getUsername()
user = system.user.getUser("", userName)
print user.get('firstname') + " " + user.get('lastname')




Panel
titleKeywords

system user getUser, user.getUser