Ejemplo n.º 1
0
 public async Task <UserAdminObject> ConvertUserResultToUserAdminObjectAsync(kCura.Relativity.Client.DTOs.User userResult)
 {
     return(new UserAdminObject()
     {
         ArtifactId = userResult.ArtifactID,
         FirstName = { Data = userResult.FirstName },
         LastName = { Data = userResult.LastName },
         EmailAddress = { Data = userResult.EmailAddress },
         Type = { Data = await ArtifactQueries.GetChoiceNameByArtifactID(RsapiRepositoryGroup.ChoiceRepository, RsapiApiOptions, userResult.Type.ArtifactID) },
         Client = { Data = await ArtifactQueries.GetClientNameByArtifactID(RsapiRepositoryGroup.ClientRepository, RsapiApiOptions, userResult.Client.ArtifactID) },
         RelativityAccess = { Data = userResult.RelativityAccess.ToString() },
         DocumentSkip = { Data = await ArtifactQueries.GetChoiceNameByArtifactID(RsapiRepositoryGroup.ChoiceRepository, RsapiApiOptions, userResult.DocumentSkip.ArtifactID) },
         BetaUser = { Data = userResult.BetaUser.ToString() },
         ChangeSettings = { Data = userResult.ChangeSettings.ToString() },
         KeyboardShortcuts = { Data = userResult.KeyboardShortcuts.ToString() },
         ItemListPageLength = { Data = userResult.ItemListPageLength.ToString() },
         DefaultSelectedFileType = { Data = await ArtifactQueries.GetChoiceNameByArtifactID(RsapiRepositoryGroup.ChoiceRepository, RsapiApiOptions, userResult.DefaultSelectedFileType.ArtifactID) },
         SkipDefaultPreference = { Data = await ArtifactQueries.GetChoiceNameByArtifactID(RsapiRepositoryGroup.ChoiceRepository, RsapiApiOptions, userResult.SkipDefaultPreference.ArtifactID) },
         EnforceViewerCompatibility = { Data = userResult.EnforceViewerCompatibility.ToString() },
         AdvancedSearchPublicByDefault = { Data = userResult.AdvancedSearchPublicByDefault.ToString() },
         NativeViewerCacheAhead = { Data = userResult.NativeViewerCacheAhead.ToString() },
         ChangeDocumentViewer = { Data = userResult.CanChangeDocumentViewer.ToString() },
         DocumentViewer = { Data = await ArtifactQueries.GetChoiceNameByArtifactID(RsapiRepositoryGroup.ChoiceRepository, RsapiApiOptions, userResult.DocumentViewer.ArtifactID) },
         Keywords = { Data = null },
         Notes = { Data = null },
         Groups = { Data = null },
         WindowsAccount = { Data = null },
         UserMustChangePasswordOnNextLogin = { Data = userResult.ChangePasswordNextLogin.GetValueOrDefault().ToString() },
         CanChangePassword = { Data = userResult.ChangePassword.GetValueOrDefault().ToString() },
         MaximumPasswordAgeInDays = { Data = userResult.MaximumPasswordAge.GetValueOrDefault().ToString() },
         TwoFactorMode = { Data = null },
         TwoFactorInfo = { Data = null }
     });
 }