gs.getUser(); |
Returns a reference to the user object for the currently logged-in user |
var userObject = gs.getUser(); |
gs.getUserByID(); |
Returns a reference to the user object for the user ID (or sys_id) provided |
var userObject = gs.getUser().getUserByID('john_smith'); |
gs.getUserName(); |
Returns the User ID (user_name) for the currently logged-in user |
var userObject = gs.getUserName(); |
gs.getUserDisplayName(); |
Returns the display value for the currently logged-in user. i.e. 'John Smith' |
var userObject = gs.getUserDisplayName(); |
gs.getUserID(); |
Returns the sys_id string value for the currently logged-in user |
var userID = gs.getUserID(); |
gs.getFirstName(); |
Returns the first name of the currently logged-in user |
var firstName = gs.getUser().getFirstName(); |
gs.getLastName(); |
Returns the last name of the currently logged-in user |
var lastName = gs.getUser().getLastName(); |
gs.getEmail(); |
Returns the email address of the currently logged-in user |
var email = gs.getUser().getEmail(); |
gs.getDepartmentID(); |
Returns the department sys_id of the currently logged-in user |
var deptID = gs.getUser().getDepartmentID(); |
gs.getCompanyID(); |
Returns the company sys_id of the currently logged-in user |
var companyID = gs.getUser().getCompanyID(); |
gs.getCompanyRecord(); |
Returns the company GlideRecord of the currently logged-in user. |
var company = gs.getUser().getCompanyRecord(); |
gs.getLanguage(); |
Returns the language of the currently logged-in user |
var language = gs.getUser().getLanguage(); |
gs.getLocation(); |
Returns the location of the currently logged-in user |
var location = gs.getUser().getLocation(); |
gs.getDomainID(); |
Returns the domain sys_id of the currently logged-in user (only used for instances that are using domain separation) |
var DomainID = gs.getUser().getDomainID(); |
gs.getDomainDisplayValue(); |
Returns the domain display value of the currently logged-in user (only used for instances that are using domain separation) |
var domainName = gs.getUser().getDomainDisplayValue(); |
gs.getManagerID(); |
Returns the manager sys_id of the currently logged-in user |
var managerID = gs.getUser().getManagerID(); |
gs.getMyGroups(); |
Returns a list of all groups that the currently logged-in user is a member of |
var groups = gs.getUser().getMyGroups(); |
gs.isMemberOf(); |
Returns true if the user is a member of the given group, false otherwise |
var isMember = gs.getUser().isMemberOf(); |
gs.hasRole(); |
Returns true if the user has the given role, false otherwise |
if (gs.hasRole('snc_internal')) { do something } |
gs.hasRole(); |
Returns true if the user has one of the given roles, false otherwise |
if (gs.hasRole('hr', 'itil')) { do something } |
gs.hasRoles(); |
Returns true if the user has any roles at all, false if the user has no role (i.e. an ess user) |
if (gs.getUser.hasRoles() { do something } |