Skip to main content
User administration.

Constructors

NSUserAgent()

User administration.

Methods

AddOwnerContact(Integer)

Returns: CRMScript.Global.Void

CanChangePassword(Integer)

Checks if the current associate can change the password for an associate
Returns: CRMScript.Global.Bool Example:

ChangeOwnPassword(String,String)

Changes password for a user.
Returns: CRMScript.Global.Bool Example:

ChangePassword(Integer,String,String)

Changes password for a user.
Returns: CRMScript.Global.Bool Example:

ChangePasswordFromName(String,String,String)

Changes password for a user.
Returns: CRMScript.Global.Bool Example:

ChangeUserType(NSUser,Integer)

Gets a user from the user name.
Returns: CRMScript.NetServer.NSUser Example:

CheckAccessGatewayRegistration()

Checks if AccessGatewayRegistration is valid
Returns: CRMScript.Global.Bool Example:

CreateDefaultRoleEntity()

Sets default values into a new NSRoleEntity.
Returns: CRMScript.NetServer.NSRoleEntity
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Example:

CreateDefaultRoleEntityFromType(Integer)

Creates a new role entity of the specified role type. The role type cannot be changed after the entity is created.
Returns: CRMScript.NetServer.NSRoleEntity Example:

CreateDefaultServiceAuth()

Sets default values into a new NSServiceAuth.
Returns: CRMScript.NetServer.NSServiceAuth
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Example:

CreateDefaultUntrustedCredentials()

Sets default values into a new NSUntrustedCredentials.
Returns: CRMScript.NetServer.NSUntrustedCredentials
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Example:

CreateDefaultUser()

Sets default values into a new NSUser.
Returns: CRMScript.NetServer.NSUser
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Example:

CreateDefaultUserFromUserType(Integer)

Creates default NSUser providing the user type. Only System and Anonymous users can be created without an existing person.
Returns: CRMScript.NetServer.NSUser
Use CreateDefaultUserFromUserTypeAndPersonId to create internal (i.e. Employee) or external users.
Example:

CreateDefaultUserFromUserTypeAndCredential(Integer,Integer,String,String,String)

Creates an NSPersonEntity with default values based on the contactId and credentials.
Returns: CRMScript.NetServer.NSUser

CreateDefaultUserFromUserTypeAndPersonId(Integer,Integer)

Creates default NSUser providing the associate type and person id. System and Anonymous users can be created without an existing person and permits person id to be 0.
Returns: CRMScript.NetServer.NSUser Example:

CreateExternalUser(Integer,String,String,Integer,Bool)

Creates an associate of type external user.
Returns: CRMScript.Global.Integer Example:

CreateUserGroup()

Creates UserGroup (Rank is assigned to the highest rank)
Returns: CRMScript.NetServer.NSUserGroup

DecryptAndSaveExternalTokens(NSTokenManagementInfo)

First asks AccessGateway to decrypt the tokens, then saves the external tokens to the DB and returns a key that can be used to retrieve them
Returns: CRMScript.Global.String Example:

DeleteCredential(Integer,String)

Removes credential of a specific type for a user
Returns: CRMScript.Global.Bool Example:

DeleteExternalUser(Integer)

Deletes an associate of type external user.
Returns: CRMScript.Global.Void

DeleteRole(Integer,Integer)

Deletes the specified role and move all users associated with the role to the replacingRoleId
Returns: CRMScript.Global.Void

DeleteServiceAuth(Integer)

Deletes the NSServiceAuth
Returns: CRMScript.Global.Void Example:

DeleteUser(Integer)

Deletes the NSUser
Returns: CRMScript.Global.Void Example:

DeleteUserFromName(String)

Deletes a user, with lookup based on the user name.
Returns: CRMScript.Global.Void Example:

DeleteUserGroup(Integer,Integer)

Deletes a user group and move its members to another user group
Returns: CRMScript.Global.Void

FindCredentialsGroups(String,String)

Gets user groups holding users filtered by the searchString.
Returns: CRMScript.NetServer.NSCredentialsGroup[] - There will always be at least one groups even if the underlying provider does not support groups.
This method is only relevant if the CredentialType control is of type link.

FindCredentialUsers(String,String)

Find users matching the partial name.
Returns: CRMScript.NetServer.NSCredentialsGroupUsers

FindRolesWithFunctionalRight(String)

Finds all roles with a given functional right. The roles matched must contain the specified functional right.
Returns: CRMScript.NetServer.NSMDOListItem[] Example:

FindRolesWithFunctionalRights(String[])

Finds all roles with a given set of functional rights. The roles matched must contain one or more of the specified functional rights.
Returns: CRMScript.Global.Integer[] Example:

FindRolesWithoutFunctionalRights(String[])

Finds all roles without a given set of functional rights. The roles matched must not contain any of the specified functional rights.
Returns: CRMScript.Global.Integer[] Example:

GenerateNewPasswordForExternalUser(String)

Generates a new password for an external user.
Returns: CRMScript.Global.String Example:

GetAccessGatewayInfo()

Returns accessgateway registration info
Returns: CRMScript.NetServer.NSAccessGatewayInfo

GetAccessToken(String,Bool)

Gets an access token based on the current user’s session.
Returns: CRMScript.Global.String Example:

GetAllFunctionalRights(Integer)

Gets a list of all functional rights for the given type of role.
Returns: CRMScript.NetServer.NSSelectableMDOListItem[] Example:

GetAllRoles(Integer)

Gets a list of all roles for the given type of role.
Returns: CRMScript.NetServer.NSSelectableMDOListItem[] Example:

GetAllUserGroups(Bool)

Gets all user groups
Returns: CRMScript.NetServer.NSUserGroup[] Example:

GetCredentialsGroups(Integer)

Gets user groups holding users.
Returns: CRMScript.NetServer.NSCredentialsGroup[] - There will always be at least one groups even if the underlying provider does not support groups.
This method is only relevant if the CredentialType control is of type link.

GetCredentialTypes()

Gets available credential types that can be used for authentication
Returns: CRMScript.NetServer.NSCredentialType[] Example:

GetCredentialTypesForUserType(Integer)

Gets available credential types that can be used for the specified user type.
Returns: CRMScript.NetServer.NSCredentialType[] Example:

GetCredentialUsers(String,String)

Gets credential users within a user group
Returns: CRMScript.NetServer.NSCredentialsGroupUsers

GetCredentialUsersInGroup(String,String)

Gets credential users within a user group
Returns: CRMScript.NetServer.NSCredentialsGroupUsers

GetDataRight(Integer,String,Integer)

Reads one specific data right at the given position.
Returns: CRMScript.Global.String
An exception will be thrown if non existing position is specified.
Example:

GetDataRights(Integer,String)

Reads specific a set of data rights at the given row in the rights matrix.
Returns: CRMScript.Native.Map
An exception will be thrown if non existing position is specified.
Example:

GetDefaultAssociateUserName(NSUser)

Gets the default username for a person
Returns: CRMScript.Global.String

GetExternalTokens(String)

Retrieves the tokens from the DB based on the given key
Returns: CRMScript.NetServer.NSTokenManagementInfo Example:

GetFunctionalRights(Integer)

Gets all functional rights for the given role. Functional rights not set on the role are not included.
Returns: CRMScript.NetServer.NSSelectableMDOListItem[] - MDO List name = ‘FunctionRights’, extra=‘role=123’ Example:

GetRole(Integer)

Gets an NSRole object.
Returns: CRMScript.NetServer.NSRole Example:

GetRoleEntity(Integer)

Gets an NSRoleEntity object.
Returns: CRMScript.NetServer.NSRoleEntity Example:

GetServiceAuth(Integer)

Gets an NSServiceAuth object.
Returns: CRMScript.NetServer.NSServiceAuth Example:

GetUntrustedCredentials(String)

Gets a set of credentials of a specified type for authenticated user.
Returns: CRMScript.NetServer.NSUntrustedCredentials[] Example:

GetUntrustedCredentialsForAssociate(Integer,String)

Gets a set of credentials of a specified type for a specified user. SecretValue is only populated for authenticated user, and system users.
Returns: CRMScript.NetServer.NSUntrustedCredentials[] Example:

GetUser(Integer)

Gets an NSUser object.
Returns: CRMScript.NetServer.NSUser Example:

GetUserFromEjUserId(Integer)

Gets user from ejUserId.
Returns: CRMScript.NetServer.NSUser[]
Used for eJournal Legacy Support.

GetUserFromName(String)

Gets a user, with lookup based on user name.
Returns: CRMScript.NetServer.NSUser Example:

GetUserFromPersonId(Integer)

Returns the user associated with the supplied person ID.
Returns: CRMScript.NetServer.NSUser[]

GetUserGroup(Integer)

Gets an NSUserGroup object.
Returns: CRMScript.NetServer.NSUserGroup Example:

GetUserGroupList(Integer[])

Gets an array of UserGroup objects.
Returns: CRMScript.NetServer.NSUserGroup[] Example:

GetUserInfo(Integer)

Gets an NSUserInfo object.
Returns: CRMScript.NetServer.NSUserInfo Example:

GetUserInfoList(Integer[])

Gets an array of NSUserInfo objects.
Returns: CRMScript.NetServer.NSUserInfo[] Example:

GetValidUserName(Integer,Integer,Integer,String)

Returns: CRMScript.Global.String

GetValidUserNameForNewUser(NSUser)

Generates a valid username for an unsaved user.
Returns: CRMScript.Global.String

IsNickNameUnique(Integer,String)

Returns: CRMScript.Global.Bool

IsPasswordValid(Integer,Integer,Integer,String)

Returns: CRMScript.Global.Bool

IsPasswordValidWithReason(Integer,Integer,Integer,String)

Returns: CRMScript.NetServer.NSUserValidationResult

IsUserNameValid(Integer,Integer,Integer,String,String)

Returns: CRMScript.Global.Bool

IsUserNameValidWithReason(Integer,Integer,Integer,String,String)

Returns: CRMScript.NetServer.NSUserValidationResult

MakeRetired(Integer,Bool)

Retiring a user means to remove all licenses, setting person.retired=1 and associate.deleted=1. Un-retiring a user means setting person.retired=0 and associate.deleted=0
Returns: CRMScript.Global.Void Example:

RegisterWithAccessGateway(String)

Registers with access gateway if not already done, otherwise will attempt to update.
Returns: CRMScript.NetServer.NSAccessGatewayInfo

RemoveLicenses(Integer)

Removes all user licenses.
Returns: CRMScript.Global.Void

RemoveOwnerContact(Integer)

Removes a contact from the ownercontactlink table
Returns: CRMScript.Global.Void

RemoveUntrustedCredentials(String,String)

Removes a credentials entry for authenticated user.
Returns: CRMScript.Global.Void

RemoveUntrustedCredentialsForAssociate(Integer,String,String)

Removes a credentials entry for a specified user.
Returns: CRMScript.Global.Void

ResolveUserFromInfo(Integer,String,String[],String[],Integer)

Gets a user from the provided information. If the user or associated person does not exist, it will be created on demand.
Returns: CRMScript.NetServer.NSResolvedUser Example:

SaveCredential(Integer,NSCredential)

Saves (adds/replaces) current credential of the same type for the user.
Returns: CRMScript.Global.Bool Example:

SaveExternalTokens(NSTokenManagementInfo)

Saves the external tokens to the DB and returns a key that can be used to retrieve them
Returns: CRMScript.Global.String Example:

SaveRoleEntity(NSRoleEntity)

Updates the existing NSRoleEntity or creates a new NSRoleEntity if the id parameter is 0
Returns: CRMScript.NetServer.NSRoleEntity Example:

SaveServiceAuth(NSServiceAuth)

Updates the existing NSServiceAuth or creates a new NSServiceAuth if the id parameter is 0
Returns: CRMScript.NetServer.NSServiceAuth Example:

SaveUntrustedCredentials(String,NSUntrustedCredentials)

Saves credentials for authenticated user.
Returns: CRMScript.Global.Void

SaveUntrustedCredentialsForAssociate(Integer,String,NSUntrustedCredential)

Saves credentials for a specified user.
Returns: CRMScript.Global.Void

SaveUser(NSUser)

Updates the existing NSUser or creates a new NSUser if the id parameter is 0
Returns: CRMScript.NetServer.NSUser Example:

SaveUserFromName(String,NSUser)

Saves a user, with lookup based on the user name.
Returns: CRMScript.NetServer.NSUser Example:

SaveUserGroup(NSUserGroup)

Saves a user group. Sets UserGroup.Deleted to mark a user group as deleted and invisible in the user interface.
Returns: CRMScript.NetServer.NSUserGroup Example:

SetDataRight(Integer,String,Integer,String)

Sets one specific data right at the given position.
Returns: CRMScript.Global.Void
An exception will be thrown if non existing position is specified.

SetExternalUserInfo(Integer,String,String,Bool,Integer,Integer)

Modifies an external user. Changes external users information according to the flags set in externalUserInfoModification.
Returns: CRMScript.Global.Void

SetFunctionalRights(Integer,Integer[])

Sets all functional rights for the given role. Functional rights not specified here will be removed from the role.
Returns: CRMScript.Global.Void

SetGeneratedPassword(Integer)

Returns: CRMScript.Global.String

SetGeneratedPasswordFromName(String)

Returns: CRMScript.Global.String

SetPassword(Integer,String)

Changes password for a user.
Returns: CRMScript.Global.Bool Example:

SetPasswordFromName(String,String)

Changes password for a user.
Returns: CRMScript.Global.Bool Example:

ValidateUser(NSUser)

Checks that entity is ready for saving, return error messages by field.
Returns: CRMScript.Native.Map Example: