Interface IUserAgent
Interface for the User Agent User administration
Online Restricted: This agent is not available in Online by default. User management is not allowed for partner apps.Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("User Agent", "Interface for the User Agent. User administration")]
public interface IUserAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserAgent agent = new UserAgent())
{
// call methods on agent here...
}
}
Methods
AddOwnerContactAsync(int, CancellationToken)
Declaration
Task AddOwnerContactAsync(int contactId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | contactId | Id of the contact to add as a owner contact |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
CanChangePasswordAsync(int, CancellationToken)
Check if the current assoicate can change the password for an associate
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<bool> CanChangePasswordAsync(int associateId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | AssociateId of the user to check if password can be changed |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> | True if the associate can change the password |
ChangeOwnPasswordAsync(string, string, CancellationToken)
Change password for a user.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<bool> ChangeOwnPasswordAsync(string oldPassword, string newPassword, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | oldPassword | The current password of the user. Administrators can leave this blank to force a new password upon a user. |
| string | newPassword | The new password for the user |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> | True if the password was successfully changed. |
ChangePasswordAsync(int, string, string, CancellationToken)
Change password for a user.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<bool> ChangePasswordAsync(int associateId, string oldPassword, string newPassword, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | AssociateId of the user to change password for. |
| string | oldPassword | The current password of the user. Administrators can leave this blank to force a new password upon a user. |
| string | newPassword | The new password for the user |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> | True if the password was successfully changed. |
ChangePasswordFromNameAsync(string, string, string, CancellationToken)
Change password for a user.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<bool> ChangePasswordFromNameAsync(string associateName, string oldPassword, string newPassword, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | associateName | Username of the user to change password for. |
| string | oldPassword | The current password of the user. Administrators can leave this blank to force a new password upon a user. |
| string | newPassword | The new password for the user |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> | True if the password was successfully changed. |
ChangeUserTypeAsync(User, UserType, CancellationToken)
Get a user from the user name.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<User> ChangeUserTypeAsync(User user, UserType userType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| User | user | User name of the user to get. |
| UserType | userType | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<User> | User retrieved by name |
CheckAccessGatewayRegistrationAsync(CancellationToken)
Checks if AccessGatewayRegistration is valid
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<bool> CheckAccessGatewayRegistrationAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> | True if the registration is usable |
CreateDefaultRoleEntityAsync(CancellationToken)
Loading default values into a new RoleEntity.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<RoleEntity> CreateDefaultRoleEntityAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<RoleEntity> | New RoleEntity with default values |
CreateDefaultRoleEntityFromTypeAsync(RoleType, CancellationToken)
Create a new role entity of the specified role type. The role type cannot be changed after the entity is created.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<RoleEntity> CreateDefaultRoleEntityFromTypeAsync(RoleType type, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleType | type | Type of role (Employee/External/Anonymous/System) |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<RoleEntity> | A blank role. |
CreateDefaultServiceAuthAsync(CancellationToken)
Loading default values into a new ServiceAuth.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<ServiceAuth> CreateDefaultServiceAuthAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<ServiceAuth> | New ServiceAuth with default values |
CreateDefaultUntrustedCredentialsAsync(CancellationToken)
Loading default values into a new UntrustedCredentials.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<UntrustedCredentials> CreateDefaultUntrustedCredentialsAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UntrustedCredentials> | New UntrustedCredentials with default values |
CreateDefaultUserAsync(CancellationToken)
Loading default values into a new User.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<User> CreateDefaultUserAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<User> | New User with default values |
CreateDefaultUserFromUserTypeAndCredentialAsync(UserType, int, string, string, string, CancellationToken)
Creates a PersonEntity with default values based on the contactId and credentials.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<User> CreateDefaultUserFromUserTypeAndCredentialAsync(UserType userType, int contactId, string credentialType, string credentialValue, string credentialDisplayValue, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UserType | userType | Type of associate for the user |
| int | contactId | Contact id of the person |
| string | credentialType | Type of credentials, corresponding to name of plugin and type in the credentials table. |
| string | credentialValue | This is the actuall value of the credentials. This will typically be the password or teh users SID in active directory |
| string | credentialDisplayValue | The value displayed to the user. this will typically be the users login name in active directory. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<User> |
CreateDefaultUserFromUserTypeAndPersonIdAsync(UserType, int, CancellationToken)
Create default User providing the associate type and person id. System and Anonymous users can be created without an exsisting person and permits person id to be 0.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<User> CreateDefaultUserFromUserTypeAndPersonIdAsync(UserType userType, int personId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UserType | userType | Type of associate for the user |
| int | personId | Primary key of the person to become a user. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<User> | New user object with defalt values set. |
CreateDefaultUserFromUserTypeAsync(UserType, CancellationToken)
Create default User providing the user type. Only System and Anonymous users can be created without an exsisting person. Use CreateDefaultUserFromUserTypeAndPersonId to create internal (i.e. Employee) or external users.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<User> CreateDefaultUserFromUserTypeAsync(UserType userType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UserType | userType | Type of associate for the user. This can only be System or Anonymous. Use CreateDefaultUserFromUserTypeAndPersonId to create internal (i.e. Employee) or external users. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<User> | New user object with defalt values set. |
CreateExternalUserAsync(int, string, string, int, bool, CancellationToken)
Creates an associate of type external user.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<int> CreateExternalUserAsync(int personId, string userName, string password, int roleId, bool isActive, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | personId | The personId to create an external user for. |
| string | userName | Login username. |
| string | password | Login password. |
| int | roleId | Id of role for the external user. The role must be a role of type external users. |
| bool | isActive | Set isActive to true to enable the external user to log in. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<int> | Returns the created associateId. |
CreateUserGroupAsync(CancellationToken)
Create UserGroup (Rank is assigned to the highest rank)
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<UserGroup> CreateUserGroupAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserGroup> |
DecryptAndSaveExternalTokensAsync(TokenManagementInfo, CancellationToken)
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
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<string> DecryptAndSaveExternalTokensAsync(TokenManagementInfo tokenManagementInfo, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TokenManagementInfo | tokenManagementInfo | Token information. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<string> | Key that can be used to retrieve the tokens |
DeleteCredentialAsync(int, string, CancellationToken)
Remove credential of a specific type for a user
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<bool> DeleteCredentialAsync(int userId, string credentialType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | userId | Primary key of the user (i.e. associate) |
| string | credentialType | Type of credentials, corresponding to name of plugin and type in the credentials table |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> | True if credential was sucessfully removed. |
DeleteExternalUserAsync(int, CancellationToken)
Deletes an associate of type external user.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task DeleteExternalUserAsync(int associateId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | The associateId to delete the associate entry for. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
DeleteRoleAsync(int, int, CancellationToken)
Delete the specified role and move all users associated with the role to the replacingRoleId
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task DeleteRoleAsync(int roleIdToDelete, int replacingRoleId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | roleIdToDelete | The roleId to delete |
| int | replacingRoleId | The roleId which all associated users will be moved to. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
DeleteServiceAuthAsync(int, CancellationToken)
Deletes the ServiceAuth
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task DeleteServiceAuthAsync(int serviceAuthId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | serviceAuthId | The identity of the ServiceAuth |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
DeleteUserAsync(int, CancellationToken)
Deletes the User
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task DeleteUserAsync(int userId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | userId | The identity of the User |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
DeleteUserFromNameAsync(string, CancellationToken)
Delete a user, with lookup based on the user name.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task DeleteUserFromNameAsync(string userName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | userName | User name of the user to delete. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
DeleteUserGroupAsync(int, int, CancellationToken)
Delete a usergroup and move its members to another usergroup
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task DeleteUserGroupAsync(int userGroupToDelete, int userGroupToMoveTo, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | userGroupToDelete | The id of the userGroup to delete |
| int | userGroupToMoveTo | The id of the userGroup to move the members to |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
ExecuteUserCommandAsync(string, CommandActionResult, User, CancellationToken)
Executes the custom command for User
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<CommandResult> ExecuteUserCommandAsync(string commandName, CommandActionResult actionResult, User user, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | commandName | The name of the command to execute. |
| CommandActionResult | actionResult | Result of an UI operation. |
| User | user | The User to execute commands on. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<CommandResult> | Result of the executed command |
FindCredentialUsersAsync(string, string, CancellationToken)
Find users matching the partial name.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<CredentialsGroupUsers> FindCredentialUsersAsync(string type, string searchString, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | type | Type of credentials, corresponding to name of plugin and type in the credentials table. |
| string | searchString | Partly name of the user group |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<CredentialsGroupUsers> |
FindCredentialsGroupsAsync(string, string, CancellationToken)
Get user groups holding users filtered by the searchString. This method is only relevant if the CredentialType control is of type link. There will allways be at least one groups even if the underlying provider does not support groups.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<CredentialsGroup[]> FindCredentialsGroupsAsync(string type, string searchString, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | type | Type of credentials, corresponding to name of plugin and type in the credentials table. |
| string | searchString | Partly name of domain group. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<CredentialsGroup[]> |
FindRolesWithFunctionalRightAsync(string, CancellationToken)
Find all roles with a given functional right. The roles matched must contain the specified functional right.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<MDOListItem[]> FindRolesWithFunctionalRightAsync(string functionalRightName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | functionalRightName | Functional right name to search for |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<MDOListItem[]> | Roles that contains the given functional right |
FindRolesWithFunctionalRightsAsync(string[], CancellationToken)
Find all roles with a given set of functional rights. The roles matched must contain one or more of the specified functional rights.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<int[]> FindRolesWithFunctionalRightsAsync(string[] functionalRightNames, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | functionalRightNames | An array of functional rights names to search for |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<int[]> | Role ids that contains your functional rights |
FindRolesWithoutFunctionalRightsAsync(string[], CancellationToken)
Find all roles without a given set of functional rights. The roles matched must not contain any of the specified functional rights.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<int[]> FindRolesWithoutFunctionalRightsAsync(string[] functionalRightNames, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | functionalRightNames | An array of functional rights names to search for |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<int[]> | Role ids that without your functional rights |
GenerateNewPasswordForExternalUserAsync(string, CancellationToken)
Generates a new password for an external user.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<string> GenerateNewPasswordForExternalUserAsync(string associateName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | associateName | The name of the associate to change the password for. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<string> | Returns the generated password. |
GetAccessGatewayInfoAsync(CancellationToken)
Returns accessgateway registration info
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<AccessGatewayInfo> GetAccessGatewayInfoAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<AccessGatewayInfo> |
GetAccessTokenAsync(string, bool, CancellationToken)
Get an access token based on the current user's session.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<string> GetAccessTokenAsync(string app_token, bool includeCsSession, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | app_token | Application token to get access on behalf of. Optional. |
| bool | includeCsSession | Initialize CS session for this access token?. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<string> | An access token. "8A:xyz123==" |
GetAllDataRightsAsync(int, RoleRelationToOwner, CancellationToken)
Get a list of all data rights for the given role, filtered by relation to owner. MDO List name = 'DataRights', extra='roleType=0'.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<StringDictionary> GetAllDataRightsAsync(int roleId, RoleRelationToOwner relationToOwner, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | roleId | The role id to set the functional rights for |
| RoleRelationToOwner | relationToOwner | The id of the relation to owner |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<StringDictionary> | The CRUD rights (C, CR, CRU, or CRUD) for each table related to the given role and relation to owner. |
GetAllFunctionalRightsAsync(RoleType, CancellationToken)
Get a list of all functional rights for the given type of role. MDO List name = 'FunctionRights', extra='roleType=0'
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<SelectableMDOListItem[]> GetAllFunctionalRightsAsync(RoleType roleType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleType | roleType | Type of role (Employee/External/Anonymous/System) |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<SelectableMDOListItem[]> | FunctionRight items with name and description. Code name for function right is in the extra-info property. |
GetAllRolesAsync(RoleType, CancellationToken)
Get a list of all roles for the given type of role. MDO List name = 'Roles', extra='0' (roleType)
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<SelectableMDOListItem[]> GetAllRolesAsync(RoleType roleType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleType | roleType | Type of role (Employee/External/Anonymous/System) |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<SelectableMDOListItem[]> | FunctionRight items with name and description. Code name for function right is in the extra-info property. |
GetAllUserGroupsAsync(bool, CancellationToken)
Get all user groups
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<UserGroup[]> GetAllUserGroupsAsync(bool includeDeleted, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | includeDeleted | Include user groups with Deleted set to true |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserGroup[]> | All user groups |
GetCredentialTypesAsync(CancellationToken)
Get available credential types that can be used for authentication
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<CredentialType[]> GetCredentialTypesAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<CredentialType[]> | Credential types that can be used for authentication |
GetCredentialTypesForUserTypeAsync(UserType, CancellationToken)
Get available credential types that can be used for the specified user type.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<CredentialType[]> GetCredentialTypesForUserTypeAsync(UserType userType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UserType | userType | The user type to retrieve credential types for |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<CredentialType[]> | Credential types that can be used for authentication |
GetCredentialUsersInGroupAsync(string, string, CancellationToken)
Get credential users within a user group
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<CredentialsGroupUsers> GetCredentialUsersInGroupAsync(string type, string groupName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | type | Type of credentials, corresponding to name of plugin and type in the credentials table. |
| string | groupName | Name of user group needed to discover the users. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<CredentialsGroupUsers> |
GetDataRightAsync(int, string, RoleRelationToOwner, CancellationToken)
Read one specific data right at the given position. An exception will be thrown if non existing position is specified.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<string> GetDataRightAsync(int roleId, string tableName, RoleRelationToOwner relationToOwner, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | roleId | The role id to set the data right for |
| string | tableName | The name of the entity/table |
| RoleRelationToOwner | relationToOwner | The id of the relation to owner |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<string> | The data right value at the specified position (C, CR, CRU, or CRUD) |
GetDataRightsAsync(int, string, CancellationToken)
Read specific a set of data rights at the given row in the rights matrix. An exception will be thrown if non existing position is specified.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<StringDictionary> GetDataRightsAsync(int roleId, string tableName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | roleId | The role id to set the data right for |
| string | tableName | The name of the entity/table |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<StringDictionary> | The data right values for all the defined relationships (C, CR, CRU, or CRUD) |
GetDefaultAssociateUserNameAsync(User, CancellationToken)
Get the default username for a person
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<string> GetDefaultAssociateUserNameAsync(User user, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| User | user | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<string> |
GetExternalTokensAsync(string, CancellationToken)
Retrieve the tokens from the DB based on the given key
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<TokenManagementInfo> GetExternalTokensAsync(string key, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | Token retrievel key |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<TokenManagementInfo> | Key to retrieve tokens |
GetFunctionalRightsAsync(int, CancellationToken)
Get all functional rights for the given role. Functional rights not set on the role are not included. MDO List name = 'FunctionRights', extra='role=123'
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<SelectableMDOListItem[]> GetFunctionalRightsAsync(int roleId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | roleId | The role id to get the functional rights for. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<SelectableMDOListItem[]> | FunctionRight items with name and description. Code name for function right is in the extra-info property. |
GetOrRegisterAccessGatewayInfoAsync(string, CancellationToken)
Returns accessgateway registration info and registers a new or adds the url if necessary
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<AccessGatewayInfo> GetOrRegisterAccessGatewayInfoAsync(string redirectUri, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | redirectUri | This is the registered redirect_uri for AccessGateway OIDC. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<AccessGatewayInfo> |
GetRoleAsync(int, CancellationToken)
Gets a Role object.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<Role> GetRoleAsync(int roleId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | roleId | The identifier of the Role object |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<Role> | A single Role |
GetRoleEntityAsync(int, CancellationToken)
Gets a RoleEntity object.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<RoleEntity> GetRoleEntityAsync(int roleEntityId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | roleEntityId | The identifier of the RoleEntity object |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<RoleEntity> | A single RoleEntity |
GetServiceAuthAsync(int, CancellationToken)
Gets a ServiceAuth object.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<ServiceAuth> GetServiceAuthAsync(int serviceAuthId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | serviceAuthId | The identifier of the ServiceAuth object |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<ServiceAuth> | A single ServiceAuth |
GetSupportedChangePasswordTypesAsync(int, CancellationToken)
Get the different methods the user can use to change password
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<ChangePasswordType[]> GetSupportedChangePasswordTypesAsync(int associateId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | AssociateId of the user to check if password can be changed |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<ChangePasswordType[]> | List of types - empty if the user cannot change password in any way |
GetUntrustedCredentialsAsync(string, CancellationToken)
Get a set of credentials of a specified type for authenticated user.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<UntrustedCredentials[]> GetUntrustedCredentialsAsync(string type, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | type | Type of credential(Ex: "imap", "smtp"). |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UntrustedCredentials[]> | Array of credentials of the specified type. |
GetUntrustedCredentialsForAssociateAsync(int, string, CancellationToken)
Get a set of credentials of a specified type for a specified user. SecretValue is only populated for authenticated user, and system users.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<UntrustedCredentials[]> GetUntrustedCredentialsForAssociateAsync(int associateId, string type, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | Id of user to retrieve credentials for. |
| string | type | Type of credential(Ex: "imap", "smtp"). |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UntrustedCredentials[]> | Array of credentials of the specified type. |
GetUserAsync(int, CancellationToken)
Gets a User object.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<User> GetUserAsync(int userId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | userId | The identifier of the User object |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<User> | A single User |
GetUserCommandsAsync(User, CancellationToken)
Get registered custom commands for User
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<CustomCommand[]> GetUserCommandsAsync(User user, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| User | user | The User |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<CustomCommand[]> | Custom commands for the User |
GetUserFromEjUserIdAsync(int, CancellationToken)
Get user from ejUserId - used for eJournal Legacy Support.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<User[]> GetUserFromEjUserIdAsync(int ejUserId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | ejUserId | ejUserId - |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<User[]> |
GetUserFromNameAsync(string, CancellationToken)
Get a user, with lookup based on user name.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<User> GetUserFromNameAsync(string userName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | userName | User name of the user to get. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<User> | User retrieved by name |
GetUserFromPersonIdAsync(int, CancellationToken)
Returns the user associated with the supplied person id
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<User[]> GetUserFromPersonIdAsync(int personId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | personId | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<User[]> |
GetUserGroupAsync(int, CancellationToken)
Gets a UserGroup object.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<UserGroup> GetUserGroupAsync(int userGroupId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | userGroupId | The identifier of the UserGroup object |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserGroup> | A single UserGroup |
GetUserGroupListAsync(int[], CancellationToken)
Gets an array of UserGroup objects.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<UserGroup[]> GetUserGroupListAsync(int[] userGroupIds, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | userGroupIds | The identifiers of the UserGroup object |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserGroup[]> | Array of UserGroup |
GetUserInfoAsync(int, CancellationToken)
Gets a UserInfo object.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<UserInfo> GetUserInfoAsync(int userInfoId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | userInfoId | The identifier of the UserInfo object |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserInfo> | A single UserInfo |
GetUserInfoListAsync(int[], CancellationToken)
Gets an array of UserInfo objects.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<UserInfo[]> GetUserInfoListAsync(int[] userInfoIds, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | userInfoIds | The identifiers of the UserInfo object |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserInfo[]> | Array of UserInfo |
GetUserPresenceStatusAsync(int, CancellationToken)
Get user presence status
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<UserPresenceStatus> GetUserPresenceStatusAsync(int associateId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | AssociateId of user to retrieve status for. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserPresenceStatus> | User presence status |
GetValidUserNameAsync(int, UserType, int, string, CancellationToken)
Declaration
Task<string> GetValidUserNameAsync(int associateId, UserType type, int personId, string userName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | |
| UserType | type | |
| int | personId | |
| string | userName | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<string> |
GetValidUserNameForNewUserAsync(User, CancellationToken)
Generates a valid username for an unsaved user
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<string> GetValidUserNameForNewUserAsync(User user, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| User | user | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<string> |
IsNickNameUniqueAsync(int, string, CancellationToken)
Declaration
Task<bool> IsNickNameUniqueAsync(int associateId, string nickName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | |
| string | nickName | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> |
IsPasswordValidAsync(int, UserType, int, string, CancellationToken)
Declaration
Task<bool> IsPasswordValidAsync(int associateId, UserType type, int personId, string password, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | |
| UserType | type | |
| int | personId | |
| string | password | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> |
IsPasswordValidWithReasonAsync(int, UserType, int, string, CancellationToken)
Declaration
Task<UserValidationResult> IsPasswordValidWithReasonAsync(int associateId, UserType type, int personId, string password, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | |
| UserType | type | |
| int | personId | |
| string | password | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserValidationResult> |
IsUserNameValidAsync(int, UserType, int, string, CancellationToken)
Declaration
Task<bool> IsUserNameValidAsync(int associateId, UserType type, int personId, string userName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | |
| UserType | type | |
| int | personId | |
| string | userName | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> |
IsUserNameValidWithReasonAsync(int, UserType, int, string, CancellationToken)
Declaration
Task<UserValidationResult> IsUserNameValidWithReasonAsync(int associateId, UserType type, int personId, string userName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | |
| UserType | type | |
| int | personId | |
| string | userName | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserValidationResult> |
MakeRetiredAsync(int, bool, CancellationToken)
Retiring a user means to remove all licenses, setting person.retired=1 and associate.deleted=1. Unretiering a user means setting person.retired=0 and associate.deleted=0
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task MakeRetiredAsync(int associateId, bool retired, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | |
| bool | retired | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
RegisterWithAccessGatewayAsync(string, CancellationToken)
Registers with access gateway if not already done, otherwise will attempt to update
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<AccessGatewayInfo> RegisterWithAccessGatewayAsync(string redirectUri, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | redirectUri | This is the registered redirect_uri for AccessGateway OIDC. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<AccessGatewayInfo> |
RemoveLicensesAsync(int, CancellationToken)
Remove all user licenses.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task RemoveLicensesAsync(int associateId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
RemoveOwnerContactAsync(int, CancellationToken)
Remove a contact from the ownercontactlink table
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task RemoveOwnerContactAsync(int contactId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | contactId | The id of the contact to remove |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
RemoveUntrustedCredentialsAsync(string, string, CancellationToken)
Remove a credentials entry for authenticated user.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task RemoveUntrustedCredentialsAsync(string type, string publicValue, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | type | Type of credential(Ex: "imap", "smtp") |
| string | publicValue | PublicValue field of credentials to remove. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
RemoveUntrustedCredentialsForAssociateAsync(int, string, string, CancellationToken)
Remove a credentials entry for a specified user.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task RemoveUntrustedCredentialsForAssociateAsync(int associateId, string type, string publicValue, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | Id of user to remove credentials for. |
| string | type | Type of credential(Ex: "imap", "smtp") |
| string | publicValue | PublicValue field of credentials to remove. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
ResolveUserFromInfoAsync(int, string, string[], string[], UserType, Credential, CancellationToken)
Get a user from the provided information. If the user or associated person does not exist, it will be created on demand.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<ResolvedUser> ResolveUserFromInfoAsync(int contactId, string personName, string[] phoneNumbers, string[] emails, UserType userType, Credential credential, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | contactId | The contact Id of the contact which the person belongs to. Cannot be 0. |
| string | personName | The full name of the person to be resolved. Optional. |
| string[] | phoneNumbers | Phone numbers registered on the person. Optional. |
| string[] | emails | Email-addresses registered on the person. Optional. |
| UserType | userType | The type of user to look up or create. |
| Credential | credential | The credentials to be used for the user. Required. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<ResolvedUser> | The results of the resolve-operation. |
SaveCredentialAsync(int, Credential, CancellationToken)
Save (adds/replaces) current credential of the same type for the user.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<bool> SaveCredentialAsync(int userId, Credential credential, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | userId | Primary key of the user (i.e. associate) |
| Credential | credential | Credentials supported for authentication |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> | True if the credential was successfully saved. |
SaveExternalTokensAsync(TokenManagementInfo, CancellationToken)
Saves the external tokens to the DB and returns a key that can be used to retrieve them
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<string> SaveExternalTokensAsync(TokenManagementInfo tokenManagementInfo, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TokenManagementInfo | tokenManagementInfo | Token information. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<string> | Key that can be used to retrieve the tokens |
SaveRoleEntityAsync(RoleEntity, CancellationToken)
Updates the existing RoleEntity or creates a new RoleEntity if the id parameter is 0.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<RoleEntity> SaveRoleEntityAsync(RoleEntity roleEntity, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleEntity | roleEntity | The RoleEntity that is saved |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<RoleEntity> | New or updated RoleEntity |
SaveServiceAuthAsync(ServiceAuth, CancellationToken)
Updates the existing ServiceAuth or creates a new ServiceAuth if the id parameter is 0.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<ServiceAuth> SaveServiceAuthAsync(ServiceAuth serviceAuth, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ServiceAuth | serviceAuth | The ServiceAuth that is saved |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<ServiceAuth> | New or updated ServiceAuth |
SaveUntrustedCredentialsAsync(string, UntrustedCredentials, CancellationToken)
Save credentials for authenticated user.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task SaveUntrustedCredentialsAsync(string type, UntrustedCredentials credentials, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | type | Type of credential(Ex: "imap", "smtp") |
| UntrustedCredentials | credentials | Credentials to save. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
SaveUntrustedCredentialsForAssociateAsync(int, string, UntrustedCredentials, CancellationToken)
Save credentials for a specified user.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task SaveUntrustedCredentialsForAssociateAsync(int associateId, string type, UntrustedCredentials credentials, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | Id of user to save credentials for. |
| string | type | Type of credential(Ex: "imap", "smtp") |
| UntrustedCredentials | credentials | Credentials to save. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
SaveUserAsync(User, CancellationToken)
Updates the existing User or creates a new User if the id parameter is 0.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<User> SaveUserAsync(User user, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| User | user | The User that is saved |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<User> | New or updated User |
SaveUserFromNameAsync(string, User, CancellationToken)
Save a user, with lookup based on the user name.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<User> SaveUserFromNameAsync(string userName, User user, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | userName | User name of the user to get. |
| User | user | User object to save. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<User> | User retrieved by name |
SaveUserGroupAsync(UserGroup, CancellationToken)
Save a user group. Set UserGroup.Deleted to mark a user group as deleted and invisible in the user interface.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<UserGroup> SaveUserGroupAsync(UserGroup userGroup, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UserGroup | userGroup | UserGroup to save |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserGroup> | UserGroup as saved to the database |
SendChangePasswordEMailAsync(int, CancellationToken)
Send a change password email to this users registered address.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<OperationResult> SendChangePasswordEMailAsync(int associateId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | AssociateId of the user to change password for. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<OperationResult> | Result - with result flag and optional error reason. |
SetDataRightAsync(int, string, RoleRelationToOwner, string, CancellationToken)
Set one specific data right at the given position. An exception will be thrown if non existing position is specified.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task SetDataRightAsync(int roleId, string tableName, RoleRelationToOwner relationToOwner, string dataRightValue, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | roleId | The role id to set the data right for |
| string | tableName | The name of the entity/table |
| RoleRelationToOwner | relationToOwner | The id of the relation to owner |
| string | dataRightValue | The data right value to set at the specified position (CRUD) |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
SetExternalUserInfoAsync(int, string, string, bool, int, ExternalUserInfoModification, CancellationToken)
Modifies an external user. Changes external users information according to the flags set in externalUserInfoModification.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task SetExternalUserInfoAsync(int associateId, string userName, string password, bool isActive, int roleId, ExternalUserInfoModification externalUserInfoModification, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | The associateId to alter. |
| string | userName | Login username. |
| string | password | Login password. |
| bool | isActive | Set isActive to true to enable the external user to log in. |
| int | roleId | Id of role for the external user. The role must be a role of type external users. |
| ExternalUserInfoModification | externalUserInfoModification | externalUserInfoModification is a flag describing what to change. <see cref="SuperOffice.CRM.Services.Util.ExternalUserInfoModification"/>. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
SetFunctionalRightsAsync(int, int[], CancellationToken)
Set all functional rights for the given role. Functional rights not specified here will be removed from the role.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task SetFunctionalRightsAsync(int roleId, int[] functionalRightIds, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | roleId | The role id to set the functional rights for |
| int[] | functionalRightIds | An array of functional rights ids to set for this role. Rights not included here are removed from the role. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
SetGeneratedPasswordAsync(int, CancellationToken)
Declaration
Task<string> SetGeneratedPasswordAsync(int associateId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<string> |
SetGeneratedPasswordFromNameAsync(string, CancellationToken)
Declaration
Task<string> SetGeneratedPasswordFromNameAsync(string associateName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | associateName | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<string> |
SetPasswordAsync(int, string, CancellationToken)
Change password for a user.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<bool> SetPasswordAsync(int associateId, string password, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | Id of User to set password for |
| string | password | New password |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> | Succeeded? |
SetPasswordFromNameAsync(string, string, CancellationToken)
Change password for a user.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<bool> SetPasswordFromNameAsync(string associateName, string password, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | associateName | Username to set password for |
| string | password | New password |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> | Succeeded? |
SetUserPresenceStatusAsync(int, UserPresenceStatus, CancellationToken)
Set user presence status
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<UserPresenceStatus> SetUserPresenceStatusAsync(int associateId, UserPresenceStatus userPresenceStatus, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | associateId | AssociateId of user to set status for. |
| UserPresenceStatus | userPresenceStatus | User presence status to set |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserPresenceStatus> | User presence status |
ValidateUserAsync(User, CancellationToken)
Check that entity is ready for saving, return error messages by field.
Online Restricted: The User agent is not available in Online by default. User management is not allowed for partner apps.Declaration
Task<StringDictionary> ValidateUserAsync(User user, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| User | user | Entity to be checked for errors. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<StringDictionary> | Error messages tagged by field. |