Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Note: This is only for the MTOA Platform Team.

Description

Enroll a user in an application with a role associated with services and permissions.

...

Syntax

Code Block
languagec#
Task<UserApplicationManagement>await GetApplicationByApplicationIdUserApplicationManagementManager.EnrollUser(int appId, int userId, ICollection<AddUserApplicationService> userAppServices, int createdByUserId);

Returns

Code Block
languagec#
UserApplicationManagementvoid

API

POST - /api/v1/userapplications/{id}/enrolluser

...

Parameter

Description

Type

id

The identification number of the application.

Path

userId

The identification number of the user.

Query string

roleId

UserRoleType

Query string

organizationId

Organization id defaulted to null

Query string

createdByUserId

The identification number of the user who is adding userAppServices

Services of the user application enrollment

Service id:
Service id of the application that the user is going to be enrolled (application id)

Rold id (UserRoleType): Role id of the service that the user is going to be enrolled

Request body

createdByUserId

User id who is enrolling this user

Query string

Returns

...

Code Block
languagec#
const int applicationId = 12;
const int userId= 1234;
const int createdByUserId= 5678;
List<AddUserApplicationService> userAppServices = new List<AddUserApplicationService>();
userAppServices.Add(new AddUserApplicationService
{
     RoleId = UserRoleType userRoleType.Clerk,
     ServiceCd = 111
});
userAppServices.Add(new AddUserApplicationService
{
     RoleId = UserRoleType.InvoiceManager;
const int createdByUserId= 5678Inspector,
     ServiceCd = 222
});
userAppServices.Add(new AddUserApplicationService
{
    RoleId = UserRoleType.Manager,
    ServiceCd = 333
});

await _userApplicationManagementManagerMtoaApi.UserApplicationManagementApi.EnrollUser(applicationId, userId, userRoleTypeuserAppServices, createdByUserId);