Script User

ScriptUser returns information about a user. It is obtained either by calling application.getUser(), or from the userCurrent attribute in an extension script.

String = getUserLogonReference() Returns the user logon reference of the user.
int = getUserIdentifier() Returns the numeric user identifier of the user.
String = getUserName() Returns the name of the user, or null if the user does not exist.
String = getUserEmail() Returns the email address of the user, or null if no email is defined.
boolean = getUserEnabled() Returns whether the user is currently enabled.
String = getUserCapabilities()

Returns the user capabilities. User capabilities are used to turn parts of the user interface on and off. Capabilities is a blank-delimited string of:

  • The permission type references for all permissions that this user has.
  • Capabilities to indicate whether this user can access account information:
    • account-read – user can read the account node
    • account-execute – user can execute the account node
    • account-read-properties – user can read the account properties node
    • account-change-theme – user can change the account theme

If the user has no capabilities (for example, because they are not signed in), this returns "", not null.

ScriptNode = getUserNode() The user node.
ScriptNode = getAccountNode() The user's account node.
String = getAccountReference() New in 4.1.4. The reference of the user's account.
String = getOwningUserGroupReference() Get the reference of this user's owning user group, or null if they don't have one.
boolean = mayMaintainProfile([permittedUser])

Indicate whether the permittedUser is permitted to maintain the profile (name and email) of the script user. permittedUser can be passed in as a numeric user identifier, user logon reference or another user object.

If permittedUser is omitted, the permission of the user who created the ScriptUser object is tested, not the permission of the script user.

To test the user's permission to maintain their own profile, use something like user.mayMaintainProfile(user).

boolean = mayUpdatePassword([permittedUser])

Indicate whether the permitted user is permitted to update the password of the script user.

See above for comments on permittedUser.

Users can always update their own passwords.

boolean = mayAdminister([permittedUser])

Indicate whether the permitted user is permitted to administer the script user, for example to delete them.

See above for comments on permittedUser.

When a ScriptUser object is passed on the userCurrent attribute in an extension script, only the logon reference, user identifier and capabilities are returned. All other methods return null.