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.

...

Code Block
languagec#
await UserApplicationManagementManager.EnrollUser(int appId, int userId, UserRoleTypeICollection<AddUserApplicationService> roleIduserAppServices, int createdByUserId, int? organizationId = null);

Returns

Code Block
languagec#
void

...

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.Clerk,
     ServiceCd = 230
});
userAppServices.Add(new AddUserApplicationService
{
     RoleId = UserRoleType.Inspector,
     ServiceCd = 231
});
userAppServices.Add(new AddUserApplicationService
{
    RoleId = UserRoleType.Manager,
    ServiceCd = 232
});

List<UserApplicationService> userAppServicesList = new List<UserApplicationService>();
foreach (var userAppService in userAppServices) {
      userAppServicesList.Add(userAppService);
}

//Enroll
the
user
await MtoaApi.UserApplicationManagementApi.EnrollUser(mitracAppId, user.Id, userAppServices, createdByUserId);
 
          
await _userApplicationManagementManager.EnrollUser(applicationId, userId, userRoleType, createdByUserId);