public ActionResult DeleteUserProductProfile(string productId) { try { Guid? organizationId = RequestItemsService.OrganizationId; string accessToken = RequestItemsService.User.AccessToken; string basePath = RequestItemsService.Session.AdminApiBasePath; Guid accountId = Guid.Parse(RequestItemsService.Session.AccountId); string email = RequestItemsService.EmailAddress; RemoveUserProductsResponse response = DeleteUserProductPermissionProfileById.DeleteUserProductPermissionProfile( basePath, accessToken, organizationId, accountId, email, Guid.Parse(productId) ); ViewBag.h1 = "Delete user product permission profiles using an email address"; ViewBag.message = "Results from MultiProductUserManagement:removeUserProductPermission method:"; ViewBag.Locals.Json = JsonConvert.SerializeObject(response, Formatting.Indented); return(View("example_done")); } catch (ApiException apiException) { ViewBag.errorCode = apiException.ErrorCode; ViewBag.errorMessage = apiException.Message; return(View("Error")); } }
protected override void InitializeInternal() { Guid? organizationId = RequestItemsService.OrganizationId; string accessToken = RequestItemsService.User.AccessToken; string basePath = RequestItemsService.Session.AdminApiBasePath; Guid accountId = Guid.Parse(RequestItemsService.Session.AccountId); products = new Dictionary <Guid?, string>(); if (RequestItemsService.EmailAddress != null) { var profiles = DeleteUserProductPermissionProfileById.GetPermissionProfilesByEmail( basePath, accessToken, organizationId, accountId, RequestItemsService.EmailAddress ); var clmProfiles = profiles.ProductPermissionProfiles .Find(x => x.ProductName == "CLM")? .PermissionProfiles .Select(x => x.PermissionProfileName).ToList(); var eSignProfiles = profiles.ProductPermissionProfiles .Find(x => x.ProductName == "ESign")? .PermissionProfiles? .Select(x => x.PermissionProfileName).ToList(); var clmProfilesFormatted = clmProfiles != null ? string.Join(",", clmProfiles) : CLM_PROFILES_NOT_FOUND; var eSignProfilesFormatted = eSignProfiles != null ? string.Join(",", eSignProfiles) : ESIGN_PROFILES_NOT_FOUND; products.TryAdd(clmProductId, string.Format("CLM - {0}", clmProfilesFormatted)); products.TryAdd(eSignatureProductId, string.Format("eSignature - {0}", eSignProfilesFormatted)); ViewBag.Products = products; } ViewBag.EmailAddress = RequestItemsService.EmailAddress; }