Class NSUserAgent
Syntax
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
Constructors
NSUserAgent()
Declaration
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
Methods
Declaration
Void AddOwnerContact(Integer contactId)
Parameters
Type |
Name |
Description |
Integer |
contactId |
|
Returns
NSUserAgent agent;
agent.callMethod(arg1, arg2);
CanChangePassword(Integer)
Checks if the current associate can change the password for an associate
Declaration
Bool CanChangePassword(Integer associateId)
Parameters
Type |
Name |
Description |
Integer |
associateId |
|
Returns
Examples
NSUserAgent agent;
Integer associateId;
Bool res = agent.CanChangePassword(associateId);
ChangeOwnPassword(String,String)
Changes password for a user.
Declaration
Bool ChangeOwnPassword(String oldPassword, String newPassword)
Parameters
Returns
Examples
NSUserAgent agent;
String oldPassword;
String newPassword;
Bool res = agent.ChangeOwnPassword(oldPassword, newPassword);
ChangePassword(Integer,String,String)
Changes password for a user.
Declaration
Bool ChangePassword(Integer associateId, String oldPassword, String newPassword)
Parameters
Returns
Examples
NSUserAgent agent;
Integer associateId;
String oldPassword;
String newPassword;
Bool res = agent.ChangePassword(associateId, oldPassword, newPassword);
ChangePasswordFromName(String,String,String)
Changes password for a user.
Declaration
Bool ChangePasswordFromName(String associateName, String oldPassword, String newPassword)
Parameters
Returns
Examples
NSUserAgent agent;
String associateName;
String oldPassword;
String newPassword;
Bool res = agent.ChangePasswordFromName(associateName, oldPassword, newPassword);
ChangeUserType(NSUser,Integer)
Gets a user from the user name.
Declaration
NSUser ChangeUserType(NSUser user, Integer userType)
Parameters
Returns
Examples
NSUserAgent agent;
NSUser user;
Integer userType;
NSUser res = agent.ChangeUserType(user, userType);
CheckAccessGatewayRegistration()
Checks if AccessGatewayRegistration is valid
Declaration
Bool CheckAccessGatewayRegistration()
Returns
Examples
NSUserAgent agent;
Bool res = agent.CheckAccessGatewayRegistration();
CreateDefaultRoleEntity()
Sets default values into a new NSRoleEntity.
Declaration
NSRoleEntity CreateDefaultRoleEntity()
Returns
Examples
NSUserAgent agent;
NSRoleEntity thing = agent.CreateDefaultRoleEntity();
thing = agent.SaveRoleEntity(thing);
CreateDefaultRoleEntityFromType(Integer)
Creates a new role entity of the specified role type. The role type cannot be changed after the entity is created.
Declaration
NSRoleEntity CreateDefaultRoleEntityFromType(Integer type)
Parameters
Returns
Examples
NSUserAgent agent;
Integer type;
NSRoleEntity res = agent.CreateDefaultRoleEntityFromType(type);
CreateDefaultServiceAuth()
Sets default values into a new NSServiceAuth.
Declaration
NSServiceAuth CreateDefaultServiceAuth()
Returns
Examples
NSUserAgent agent;
NSServiceAuth thing = agent.CreateDefaultServiceAuth();
thing = agent.SaveServiceAuth(thing);
CreateDefaultUntrustedCredentials()
Sets default values into a new NSUntrustedCredentials.
Declaration
NSUntrustedCredentials CreateDefaultUntrustedCredentials()
Returns
Examples
NSUserAgent agent;
NSUntrustedCredentials thing = agent.CreateDefaultUntrustedCredentials();
thing = agent.SaveUntrustedCredentials(thing);
CreateDefaultUser()
Sets default values into a new NSUser.
Declaration
NSUser CreateDefaultUser()
Returns
Examples
NSUserAgent agent;
NSUser thing = agent.CreateDefaultUser();
thing = agent.SaveUser(thing);
CreateDefaultUserFromUserType(Integer)
Creates default NSUser providing the user type. Only System and Anonymous users can be created without an existing person.
Declaration
NSUser CreateDefaultUserFromUserType(Integer userType)
Parameters
Returns
Examples
NSUserAgent agent;
Integer userType;
NSUser res = agent.CreateDefaultUserFromUserType(userType);
CreateDefaultUserFromUserTypeAndCredential(Integer,Integer,String,String,String)
Creates an NSPersonEntity with default values based on the contactId and credentials.
Declaration
NSUser CreateDefaultUserFromUserTypeAndCredential(Integer userType, Integer contactId, String credentialType, String credentialValue, String credentialDisplayValue)
Parameters
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
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.
Declaration
NSUser CreateDefaultUserFromUserTypeAndPersonId(Integer userType, Integer personId)
Parameters
Returns
Examples
NSUserAgent agent;
Integer userType;
Integer personId;
NSUser res = agent.CreateDefaultUserFromUserTypeAndPersonId(userType, personId);
CreateExternalUser(Integer,String,String,Integer,Bool)
Creates an associate of type external user.
Declaration
Integer CreateExternalUser(Integer personId, String userName, String password, Integer roleId, Bool isActive)
Parameters
Returns
Examples
NSUserAgent agent;
Integer personId;
String userName;
String password;
Integer roleId;
Bool isActive;
Integer res = agent.CreateExternalUser(personId, userName, password, roleId, isActive);
CreateUserGroup()
Creates UserGroup (Rank is assigned to the highest rank)
Declaration
NSUserGroup CreateUserGroup()
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
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
Declaration
String DecryptAndSaveExternalTokens(NSTokenManagementInfo tokenManagementInfo)
Parameters
Returns
Examples
NSUserAgent agent;
NSTokenManagementInfo tokenManagementInfo;
String res = agent.DecryptAndSaveExternalTokens(tokenManagementInfo);
DeleteCredential(Integer,String)
Removes credential of a specific type for a user
Declaration
Bool DeleteCredential(Integer userId, String credentialType)
Parameters
Returns
Examples
NSUserAgent agent;
Integer userId;
String credentialType;
Bool res = agent.DeleteCredential(userId, credentialType);
DeleteExternalUser(Integer)
Deletes an associate of type external user.
Declaration
Void DeleteExternalUser(Integer associateId)
Parameters
Type |
Name |
Description |
Integer |
associateId |
|
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
DeleteRole(Integer,Integer)
Deletes the specified role and move all users associated with the role to the replacingRoleId
Declaration
Void DeleteRole(Integer roleIdToDelete, Integer replacingRoleId)
Parameters
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
DeleteServiceAuth(Integer)
Deletes the NSServiceAuth
Declaration
DeleteServiceAuth(Integer serviceAuth)
Parameters
Type |
Name |
Description |
Integer |
serviceAuth |
|
Returns
Examples
NSUserAgent agent;
agent.DeleteServiceAuth(123);
DeleteUser(Integer)
Declaration
Parameters
Returns
Examples
NSUserAgent agent;
agent.DeleteUser(123);
DeleteUserFromName(String)
Deletes a user, with lookup based on the user name.
Declaration
Void DeleteUserFromName(String userName)
Parameters
Type |
Name |
Description |
String |
userName |
|
Returns
Examples
NSUserAgent agent;
String userName;
agent.DeleteUserFromName(userName);
DeleteUserGroup(Integer,Integer)
Deletes a user group and move its members to another user group
Declaration
Void DeleteUserGroup(Integer userGroupToDelete, Integer userGroupToMoveTo)
Parameters
Type |
Name |
Description |
Integer |
userGroupToDelete |
|
Integer |
userGroupToMoveTo |
|
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
FindCredentialsGroups(String,String)
Gets user groups holding users filtered by the searchString.
Declaration
NSCredentialsGroup[] FindCredentialsGroups(String type, String searchString)
Parameters
Returns
Type |
Description |
NSCredentialsGroup[] |
There will always be at least one groups even if the underlying provider does not support groups.
|
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
FindCredentialUsers(String,String)
Find users matching the partial name.
Declaration
NSCredentialsGroupUsers FindCredentialUsers(String type, String searchString)
Parameters
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
FindRolesWithFunctionalRight(String)
Finds all roles with a given functional right. The roles matched must contain the specified functional right.
Declaration
NSMDOListItem[] FindRolesWithFunctionalRight(String functionalRightName)
Parameters
Type |
Name |
Description |
String |
functionalRightName |
|
Returns
Examples
NSUserAgent agent;
String functionalRightName;
NSMDOListItem[] res = agent.FindRolesWithFunctionalRight(functionalRightName);
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.
Declaration
Integer[] FindRolesWithFunctionalRights(String[] functionalRightNames)
Parameters
Type |
Name |
Description |
String[] |
functionalRightNames |
|
Returns
Examples
NSUserAgent agent;
String[] functionalRightNames;
Integer[] res = agent.FindRolesWithFunctionalRights(functionalRightNames);
FindRolesWithoutFunctionalRights(String[])
Finds all roles without a given set of functional rights. The roles matched must not contain any of the specified functional rights.
Declaration
Integer[] FindRolesWithoutFunctionalRights(String[] functionalRightNames)
Parameters
Type |
Name |
Description |
String[] |
functionalRightNames |
|
Returns
Examples
NSUserAgent agent;
String[] functionalRightNames;
Integer[] res = agent.FindRolesWithoutFunctionalRights(functionalRightNames);
GenerateNewPasswordForExternalUser(String)
Generates a new password for an external user.
Declaration
String GenerateNewPasswordForExternalUser(String associateName)
Parameters
Type |
Name |
Description |
String |
associateName |
|
Returns
Examples
NSUserAgent agent;
String associateName;
String res = agent.GenerateNewPasswordForExternalUser(associateName);
GetAccessGatewayInfo()
Returns accessgateway registration info
Declaration
NSAccessGatewayInfo GetAccessGatewayInfo()
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
GetAccessToken(String,Bool)
Gets an access token based on the current user's session.
Declaration
String GetAccessToken(String appToken, Bool includeCsSession)
Parameters
Type |
Name |
Description |
String |
appToken |
|
Bool |
includeCsSession |
|
Returns
Examples
NSUserAgent agent;
String appToken;
Bool includeCsSession;
String res = agent.GetAccessToken(appToken, includeCsSession);
GetAllFunctionalRights(Integer)
Gets a list of all functional rights for the given type of role.
Declaration
NSSelectableMDOListItem[] GetAllFunctionalRights(Integer roleType)
Parameters
Type |
Name |
Description |
Integer |
roleType |
MDO List name = 'FunctionRights', extra='roleType=0'. See RoleType.
|
Returns
Examples
NSUserAgent agent;
Integer roleType;
NSSelectableMDOListItem[] res = agent.GetAllFunctionalRights(roleType);
GetAllRoles(Integer)
Gets a list of all roles for the given type of role.
Declaration
NSSelectableMDOListItem[] GetAllRoles(Integer roleType)
Parameters
Type |
Name |
Description |
Integer |
roleType |
MDO List name = 'Roles', extra='0' (roleType) See RoleType.
|
Returns
Examples
NSUserAgent agent;
Integer roleType;
NSSelectableMDOListItem[] res = agent.GetAllRoles(roleType);
GetAllUserGroups(Bool)
Declaration
NSUserGroup[] GetAllUserGroups(Bool includeDeleted)
Parameters
Type |
Name |
Description |
Bool |
includeDeleted |
|
Returns
Examples
NSUserAgent agent;
Bool includeDeleted;
NSUserGroup[] res = agent.GetAllUserGroups(includeDeleted);
GetCredentialsGroups(Integer)
Gets user groups holding users.
Declaration
NSCredentialsGroup[] GetCredentialsGroups(Integer type)
Parameters
Returns
Type |
Description |
NSCredentialsGroup[] |
There will always be at least one groups even if the underlying provider does not support groups.
|
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
GetCredentialTypes()
Gets available credential types that can be used for authentication
Declaration
NSCredentialType[] GetCredentialTypes()
Returns
Examples
NSUserAgent agent;
NSCredentialType[] res = agent.GetCredentialTypes();
GetCredentialTypesForUserType(Integer)
Gets available credential types that can be used for the specified user type.
Declaration
NSCredentialType[] GetCredentialTypesForUserType(Integer userType)
Parameters
Type |
Name |
Description |
Integer |
userType |
|
Returns
Examples
NSUserAgent agent;
Integer userType;
NSCredentialType[] res = agent.GetCredentialTypesForUserType(userType);
GetCredentialUsers(String,String)
Gets credential users within a user group
Declaration
NSCredentialsGroupUsers GetCredentialUsers(String groupName, String type)
Parameters
Type |
Name |
Description |
String |
groupName |
Name of user group needed to discover the users.
|
String |
type |
Type of credentials, corresponding to name of plugin and type in the credentials table.
|
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
GetCredentialUsersInGroup(String,String)
Gets credential users within a user group
Declaration
NSCredentialsGroupUsers GetCredentialUsersInGroup(String type, String groupName)
Parameters
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
GetDataRight(Integer,String,Integer)
Reads one specific data right at the given position.
Declaration
String GetDataRight(Integer roleId, String tableName, Integer relationToOwner)
Parameters
Returns
Examples
NSUserAgent agent;
Integer roleId;
String tableName;
Integer relationToOwner;
String res = agent.GetDataRight(roleId, tableName, relationToOwner);
GetDataRights(Integer,String)
Reads specific a set of data rights at the given row in the rights matrix.
Declaration
Map GetDataRights(Integer roleId, String tableName)
Parameters
Returns
Examples
NSUserAgent agent;
Integer roleId;
String tableName;
Map res = agent.GetDataRights(roleId, tableName);
GetDefaultAssociateUserName(NSUser)
Gets the default username for a person
Declaration
String GetDefaultAssociateUserName(NSUser user)
Parameters
Type |
Name |
Description |
NSUser |
user |
|
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
GetExternalTokens(String)
Retrieves the tokens from the DB based on the given key
Declaration
NSTokenManagementInfo GetExternalTokens(String key)
Parameters
Type |
Name |
Description |
String |
key |
|
Returns
Examples
NSUserAgent agent;
String key;
NSTokenManagementInfo res = agent.GetExternalTokens(key);
GetFunctionalRights(Integer)
Gets all functional rights for the given role. Functional rights not set on the role are not included.
Declaration
NSSelectableMDOListItem[] GetFunctionalRights(Integer roleId)
Parameters
Type |
Name |
Description |
Integer |
roleId |
|
Returns
Examples
NSUserAgent agent;
Integer roleId;
NSSelectableMDOListItem[] res = agent.GetFunctionalRights(roleId);
GetRole(Integer)
Declaration
NSRole GetRole(Integer roleId)
Parameters
Type |
Name |
Description |
Integer |
roleId |
|
Returns
Examples
NSUserAgent agent;
NSRole thing = agent.GetRole(123);
GetRoleEntity(Integer)
Gets an NSRoleEntity object.
Declaration
NSRoleEntity GetRoleEntity(Integer roleEntityId)
Parameters
Type |
Name |
Description |
Integer |
roleEntityId |
|
Returns
Examples
NSUserAgent agent;
NSRoleEntity thing = agent.GetRoleEntity(123);
GetServiceAuth(Integer)
Gets an NSServiceAuth object.
Declaration
NSServiceAuth GetServiceAuth(Integer serviceAuthId)
Parameters
Type |
Name |
Description |
Integer |
serviceAuthId |
|
Returns
Examples
NSUserAgent agent;
NSServiceAuth thing = agent.GetServiceAuth(123);
GetUntrustedCredentials(String)
Gets a set of credentials of a specified type for authenticated user.
Declaration
NSUntrustedCredentials[] GetUntrustedCredentials(String type)
Parameters
Type |
Name |
Description |
String |
type |
|
Returns
Examples
NSUserAgent agent;
String type;
NSUntrustedCredentials[] res = agent.GetUntrustedCredentials(type);
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.
Declaration
NSUntrustedCredentials[] GetUntrustedCredentialsForAssociate(Integer associateId, String type)
Parameters
Returns
Examples
NSUserAgent agent;
Integer associateId;
String type;
NSUntrustedCredentials[] res = agent.GetUntrustedCredentialsForAssociate(associateId, type);
GetUser(Integer)
Declaration
NSUser GetUser(Integer userId)
Parameters
Type |
Name |
Description |
Integer |
userId |
|
Returns
Examples
NSUserAgent agent;
NSUser thing = agent.GetUser(123);
GetUserFromEjUserId(Integer)
Declaration
NSUser[] GetUserFromEjUserId(Integer ejUserId)
Parameters
Type |
Name |
Description |
Integer |
ejUserId |
|
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
GetUserFromName(String)
Gets a user, with lookup based on user name.
Declaration
NSUser GetUserFromName(String userName)
Parameters
Type |
Name |
Description |
String |
userName |
|
Returns
Examples
NSUserAgent agent;
String userName;
NSUser res = agent.GetUserFromName(userName);
GetUserFromPersonId(Integer)
Returns the user associated with the supplied person ID.
Declaration
NSUser[] GetUserFromPersonId(Integer personId)
Parameters
Type |
Name |
Description |
Integer |
personId |
|
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
GetUserGroup(Integer)
Gets an NSUserGroup object.
Declaration
NSUserGroup GetUserGroup(Integer userGroupId)
Parameters
Type |
Name |
Description |
Integer |
userGroupId |
|
Returns
Examples
NSUserAgent agent;
NSUserGroup thing = agent.GetUserGroup(123);
GetUserGroupList(Integer[])
Gets an array of UserGroup objects.
Declaration
NSUserGroup[] GetUserGroupList(Integer[] userGroupIds)
Parameters
Type |
Name |
Description |
Integer[] |
userGroupIds |
|
Returns
Examples
Integer[] ids;
NSUserAgent agent;
agent.GetUserGroupList(ids);
GetUserInfo(Integer)
Gets an NSUserInfo object.
Declaration
NSUserInfo GetUserInfo(Integer userInfoId)
Parameters
Type |
Name |
Description |
Integer |
userInfoId |
|
Returns
Examples
NSUserAgent agent;
NSUserInfo thing = agent.GetUserInfo(123);
GetUserInfoList(Integer[])
Gets an array of NSUserInfo objects.
Declaration
NSUserInfo[] GetUserInfoList(Integer[] userInfoIds)
Parameters
Type |
Name |
Description |
Integer[] |
userInfoIds |
|
Returns
Examples
Integer[] ids;
NSUserAgent agent;
agent.GetUserInfoList(ids);
GetValidUserName(Integer,Integer,Integer,String)
Declaration
String GetValidUserName(Integer associateId, Integer type, Integer personId, String userName)
Parameters
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
GetValidUserNameForNewUser(NSUser)
Generates a valid username for an unsaved user.
Declaration
String GetValidUserNameForNewUser(NSUser user)
Parameters
Type |
Name |
Description |
NSUser |
user |
|
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
IsNickNameUnique(Integer,String)
Declaration
Bool IsNickNameUnique(Integer associateId, String nickName)
Parameters
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
IsPasswordValid(Integer,Integer,Integer,String)
Declaration
Bool IsPasswordValid(Integer associateId, Integer type, Integer personId, String password)
Parameters
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
IsPasswordValidWithReason(Integer,Integer,Integer,String)
Declaration
NSUserValidationResult IsPasswordValidWithReason(Integer associateId, Integer type, Integer personId, String password)
Parameters
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
IsUserNameValid(Integer,Integer,Integer,String,String)
Declaration
Bool IsUserNameValid(Integer associateId, Integer type, Integer personId, String userName)
Parameters
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
IsUserNameValidWithReason(Integer,Integer,Integer,String,String)
Declaration
NSUserValidationResult IsUserNameValidWithReason(Integer associateId, Integer type, Integer personId, String userName)
Parameters
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
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
Declaration
Void MakeRetired(Integer associateId, Bool retired)
Parameters
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
RegisterWithAccessGateway(String)
Registers with access gateway if not already done, otherwise will attempt to update.
Declaration
NSAccessGatewayInfo RegisterWithAccessGateway(String redirectUri)
Parameters
Type |
Name |
Description |
String |
redirectUri |
The registered redirect_uri for AccessGateway OIDC.
|
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
RemoveLicenses(Integer)
Removes all user licenses.
Declaration
Void RemoveLicenses(Integer associateId)
Parameters
Type |
Name |
Description |
Integer |
associateId |
|
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
Removes a contact from the ownercontactlink table
Declaration
Void RemoveOwnerContact(Integer contactId)
Parameters
Type |
Name |
Description |
Integer |
contactId |
|
Returns
NSUserAgent agent;
agent.callMethod(arg1, arg2);
RemoveUntrustedCredentials(String,String)
Removes a credentials entry for authenticated user.
Declaration
Void RemoveUntrustedCredentials(String type, String publicValue)
Parameters
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
RemoveUntrustedCredentialsForAssociate(Integer,String,String)
Removes a credentials entry for a specified user.
Declaration
Void RemoveUntrustedCredentialsForAssociate(Integer associateId, String type, String publicValue)
Parameters
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
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.
Declaration
NSResolvedUser ResolveUserFromInfo(Integer contactId, String personName, String[] phoneNumbers, String[] emails, Integer userType, NSCredential credential)
Parameters
Returns
Examples
NSUserAgent agent;
Integer contactId;
String personName;
String[] phoneNumbers;
String[] emails;
Integer userType;
NSCredential credential;
NSResolvedUser res = agent.ResolveUserFromInfo(contactId, personName, phoneNumbers, emails, userType, credential);
SaveCredential(Integer,NSCredential)
Saves (adds/replaces) current credential of the same type for the user.
Declaration
Bool SaveCredential(Integer userId, NSCredential credential)
Parameters
Type |
Name |
Description |
Integer |
userId |
|
|
credential |
|
Returns
Examples
NSUserAgent agent;
Integer userId;
NSCredential credential;
Bool res = agent.SaveCredential(userId, credential);
SaveExternalTokens(NSTokenManagementInfo)
Saves the external tokens to the DB and returns a key that can be used to retrieve them
Declaration
String SaveExternalTokens(NSTokenManagementInfo tokenManagementInfo)
Parameters
Returns
Examples
NSUserAgent agent;
NSTokenManagementInfo tokenManagementInfo;
String res = agent.SaveExternalTokens(tokenManagementInfo);
SaveRoleEntity(NSRoleEntity)
Updates the existing NSRoleEntity or creates a new NSRoleEntity if the id parameter is 0
Declaration
NSRoleEntity SaveRoleEntity(NSRoleEntity roleEntity)
Parameters
Type |
Name |
Description |
NSRoleEntity |
roleEntity |
The NSRoleEntity to save.
|
Returns
Examples
NSUser agent;
NSRoleEntity thing = agent.CreateDefaultRoleEntity();
thing = agent.SaveRoleEntity(thing);
SaveServiceAuth(NSServiceAuth)
Updates the existing NSServiceAuth or creates a new NSServiceAuth if the id parameter is 0
Declaration
NSServiceAuth SaveServiceAuth(NSServiceAuth serviceAuth)
Parameters
Returns
Examples
NSUser agent;
NSServiceAuth thing = agent.CreateDefaultServiceAuth();
thing = agent.SaveServiceAuth(thing);
SaveUntrustedCredentials(String,NSUntrustedCredentials)
Saves credentials for authenticated user.
Declaration
Void SaveUntrustedCredentials(String type, NSUntrustedCredentials credentials)
Parameters
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
SaveUntrustedCredentialsForAssociate(Integer,String,NSUntrustedCredential)
Saves credentials for a specified user.
Declaration
Void SaveUntrustedCredentialsForAssociate(Integer associateId, String type, NSUntrustedCredentials credentials)
Parameters
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
SaveUser(NSUser)
Updates the existing NSUser or creates a new NSUser if the id parameter is 0
Declaration
NSUser SaveUser(NSUser user)
Parameters
Type |
Name |
Description |
NSUser |
user |
The NSUser to save.
|
Returns
Examples
NSUser agent;
NSUser thing = agent.CreateDefaultUser();
thing = agent.SaveUser(thing);
SaveUserFromName(String,NSUser)
Saves a user, with lookup based on the user name.
Declaration
NSUser SaveUserFromName(String userName, NSUser user)
Parameters
Returns
Examples
NSUserAgent agent;
String userName;
NSUser user;
NSUser res = agent.SaveUserFromName(userName, user);
SaveUserGroup(NSUserGroup)
Saves a user group. Sets UserGroup.Deleted to mark a user group as deleted and invisible in the user interface.
Declaration
NSUserGroup SaveUserGroup(NSUserGroup userGroup)
Parameters
Returns
Examples
NSUserAgent agent;
NSUserGroup userGroup;
NSUserGroup res = agent.SaveUserGroup(userGroup);
SetDataRight(Integer,String,Integer,String)
Sets one specific data right at the given position.
Declaration
Void SetDataRight(Integer roleId, String tableName, Integer relationToOwner, String dataRightValue)
Parameters
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
SetExternalUserInfo(Integer,String,String,Bool,Integer,Integer)
Modifies an external user. Changes external users information according to the flags set in externalUserInfoModification.
Declaration
Void SetExternalUserInfo(Integer associateId, String userName, String password, Bool isActive, Integer roleId, Integer externalUserInfoModification)
Parameters
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
SetFunctionalRights(Integer,Integer[])
Sets all functional rights for the given role. Functional rights not specified here will be removed from the role.
Declaration
Void SetFunctionalRights(Integer roleId, Integer[] functionalRightIds)
Parameters
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
SetGeneratedPassword(Integer)
Declaration
String SetGeneratedPassword(Integer associateId)
Parameters
Type |
Name |
Description |
Integer |
associateId |
|
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
SetGeneratedPasswordFromName(String)
Declaration
String SetGeneratedPasswordFromName(String associateName)
Parameters
Type |
Name |
Description |
String |
associateName |
|
Returns
Examples
NSUserAgent agent;
agent.callMethod(arg1, arg2);
SetPassword(Integer,String)
Changes password for a user.
Declaration
Bool SetPassword(Integer associateId, String password)
Parameters
Returns
Examples
NSUserAgent agent;
Integer associateId;
String password;
Bool res = agent.SetPassword(associateId, password);
SetPasswordFromName(String,String)
Changes password for a user.
Declaration
Bool SetPasswordFromName(String associateName, String password)
Parameters
Returns
Examples
NSUserAgent agent;
String associateName;
String password;
Bool res = agent.SetPasswordFromName(associateName, password);
ValidateUser(NSUser)
Checks that entity is ready for saving, return error messages by field.
Declaration
Map ValidateUser(NSUser user)
Parameters
Type |
Name |
Description |
NSUser |
user |
|
Returns
Examples
NSUserAgent agent;
NSUser user;
Map res = agent.ValidateUser(user);