From c23c5c3e2107547c9df3e5922298617b6ecce18c Mon Sep 17 00:00:00 2001 From: Brandon Date: Wed, 26 Mar 2025 17:26:21 -0400 Subject: [PATCH] wip --- src/Admin/AdminConsole/Models/OrganizationEditModel.cs | 9 ++++----- .../Response/Organizations/OrganizationResponseModel.cs | 4 ++-- .../Models/Response/ProfileOrganizationResponseModel.cs | 4 ++-- .../Response/ProfileProviderOrganizationResponseModel.cs | 2 +- src/Core/AdminConsole/Entities/Organization.cs | 2 +- .../OrganizationUserOrganizationDetails.cs | 2 +- .../Organizations/CloudOrganizationSignUpCommand.cs | 4 ++-- 7 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/Admin/AdminConsole/Models/OrganizationEditModel.cs b/src/Admin/AdminConsole/Models/OrganizationEditModel.cs index a3525c5fbe..1bbcc69d2d 100644 --- a/src/Admin/AdminConsole/Models/OrganizationEditModel.cs +++ b/src/Admin/AdminConsole/Models/OrganizationEditModel.cs @@ -76,7 +76,6 @@ public class OrganizationEditModel : OrganizationViewModel MaxCollections = org.MaxCollections; UsePolicies = org.UsePolicies; UseSso = org.UseSso; - UseOrganizationDomains = org.UseOrganizationDomains; UseKeyConnector = org.UseKeyConnector; UseScim = org.UseScim; UseGroups = org.UseGroups; @@ -102,7 +101,7 @@ public class OrganizationEditModel : OrganizationViewModel MaxAutoscaleSmSeats = org.MaxAutoscaleSmSeats; SmServiceAccounts = org.SmServiceAccounts; MaxAutoscaleSmServiceAccounts = org.MaxAutoscaleSmServiceAccounts; - + UseOrganizationDomains = org.UseOrganizationDomains; _plans = plans; } @@ -133,8 +132,6 @@ public class OrganizationEditModel : OrganizationViewModel public bool UsePolicies { get; set; } [Display(Name = "SSO")] public bool UseSso { get; set; } - [Display(Name = "Use Organization Domains")] - public bool UseOrganizationDomains { get; set; } [Display(Name = "Key Connector with Customer Encryption")] public bool UseKeyConnector { get; set; } [Display(Name = "Groups")] @@ -186,6 +183,8 @@ public class OrganizationEditModel : OrganizationViewModel public int? SmServiceAccounts { get; set; } [Display(Name = "Max Autoscale Machine Accounts")] public int? MaxAutoscaleSmServiceAccounts { get; set; } + [Display(Name = "Use Organization Domains")] + public bool UseOrganizationDomains { get; set; } /** * Creates a Plan[] object for use in Javascript @@ -289,7 +288,6 @@ public class OrganizationEditModel : OrganizationViewModel existingOrganization.MaxCollections = MaxCollections; existingOrganization.UsePolicies = UsePolicies; existingOrganization.UseSso = UseSso; - existingOrganization.UseOrganizationDomains = UseOrganizationDomains; existingOrganization.UseKeyConnector = UseKeyConnector; existingOrganization.UseScim = UseScim; existingOrganization.UseGroups = UseGroups; @@ -316,6 +314,7 @@ public class OrganizationEditModel : OrganizationViewModel existingOrganization.MaxAutoscaleSmSeats = MaxAutoscaleSmSeats; existingOrganization.SmServiceAccounts = SmServiceAccounts; existingOrganization.MaxAutoscaleSmServiceAccounts = MaxAutoscaleSmServiceAccounts; + existingOrganization.UseOrganizationDomains = UseOrganizationDomains; return existingOrganization; } } diff --git a/src/Api/AdminConsole/Models/Response/Organizations/OrganizationResponseModel.cs b/src/Api/AdminConsole/Models/Response/Organizations/OrganizationResponseModel.cs index 11a05a805f..206b477771 100644 --- a/src/Api/AdminConsole/Models/Response/Organizations/OrganizationResponseModel.cs +++ b/src/Api/AdminConsole/Models/Response/Organizations/OrganizationResponseModel.cs @@ -40,7 +40,6 @@ public class OrganizationResponseModel : ResponseModel MaxStorageGb = organization.MaxStorageGb; UsePolicies = organization.UsePolicies; UseSso = organization.UseSso; - UseOrganizationDomains = organization.UseOrganizationDomains; UseKeyConnector = organization.UseKeyConnector; UseScim = organization.UseScim; UseGroups = organization.UseGroups; @@ -65,6 +64,7 @@ public class OrganizationResponseModel : ResponseModel LimitItemDeletion = organization.LimitItemDeletion; AllowAdminAccessToAllCollectionItems = organization.AllowAdminAccessToAllCollectionItems; UseRiskInsights = organization.UseRiskInsights; + UseOrganizationDomains = organization.UseOrganizationDomains; } public Guid Id { get; set; } @@ -87,7 +87,6 @@ public class OrganizationResponseModel : ResponseModel public short? MaxStorageGb { get; set; } public bool UsePolicies { get; set; } public bool UseSso { get; set; } - public bool UseOrganizationDomains { get; set; } public bool UseKeyConnector { get; set; } public bool UseScim { get; set; } public bool UseGroups { get; set; } @@ -112,6 +111,7 @@ public class OrganizationResponseModel : ResponseModel public bool LimitItemDeletion { get; set; } public bool AllowAdminAccessToAllCollectionItems { get; set; } public bool UseRiskInsights { get; set; } + public bool UseOrganizationDomains { get; set; } } public class OrganizationSubscriptionResponseModel : OrganizationResponseModel diff --git a/src/Api/AdminConsole/Models/Response/ProfileOrganizationResponseModel.cs b/src/Api/AdminConsole/Models/Response/ProfileOrganizationResponseModel.cs index f36dd82abd..aa0223931b 100644 --- a/src/Api/AdminConsole/Models/Response/ProfileOrganizationResponseModel.cs +++ b/src/Api/AdminConsole/Models/Response/ProfileOrganizationResponseModel.cs @@ -25,7 +25,6 @@ public class ProfileOrganizationResponseModel : ResponseModel Name = organization.Name; UsePolicies = organization.UsePolicies; UseSso = organization.UseSso; - UseOrganizationDomains = organization.UseOrganizationDomains; UseKeyConnector = organization.UseKeyConnector; UseScim = organization.UseScim; UseGroups = organization.UseGroups; @@ -73,6 +72,7 @@ public class ProfileOrganizationResponseModel : ResponseModel AllowAdminAccessToAllCollectionItems = organization.AllowAdminAccessToAllCollectionItems; UserIsManagedByOrganization = organizationIdsManagingUser.Contains(organization.OrganizationId); UseRiskInsights = organization.UseRiskInsights; + UseOrganizationDomains = organization.UseOrganizationDomains; if (organization.SsoConfig != null) { @@ -87,7 +87,6 @@ public class ProfileOrganizationResponseModel : ResponseModel public string Name { get; set; } public bool UsePolicies { get; set; } public bool UseSso { get; set; } - public bool UseOrganizationDomains { get; set; } public bool UseKeyConnector { get; set; } public bool UseScim { get; set; } public bool UseGroups { get; set; } @@ -146,4 +145,5 @@ public class ProfileOrganizationResponseModel : ResponseModel /// public bool UserIsManagedByOrganization { get; set; } public bool UseRiskInsights { get; set; } + public bool UseOrganizationDomains { get; set; } } diff --git a/src/Api/AdminConsole/Models/Response/ProfileProviderOrganizationResponseModel.cs b/src/Api/AdminConsole/Models/Response/ProfileProviderOrganizationResponseModel.cs index 10002486bc..e39fff2413 100644 --- a/src/Api/AdminConsole/Models/Response/ProfileProviderOrganizationResponseModel.cs +++ b/src/Api/AdminConsole/Models/Response/ProfileProviderOrganizationResponseModel.cs @@ -15,7 +15,6 @@ public class ProfileProviderOrganizationResponseModel : ProfileOrganizationRespo Name = organization.Name; UsePolicies = organization.UsePolicies; UseSso = organization.UseSso; - UseOrganizationDomains = organization.UseOrganizationDomains; UseKeyConnector = organization.UseKeyConnector; UseScim = organization.UseScim; UseGroups = organization.UseGroups; @@ -51,5 +50,6 @@ public class ProfileProviderOrganizationResponseModel : ProfileOrganizationRespo LimitItemDeletion = organization.LimitItemDeletion; AllowAdminAccessToAllCollectionItems = organization.AllowAdminAccessToAllCollectionItems; UseRiskInsights = organization.UseRiskInsights; + UseOrganizationDomains = organization.UseOrganizationDomains; } } diff --git a/src/Core/AdminConsole/Entities/Organization.cs b/src/Core/AdminConsole/Entities/Organization.cs index ad0e37e1e5..8cc34c8d5c 100644 --- a/src/Core/AdminConsole/Entities/Organization.cs +++ b/src/Core/AdminConsole/Entities/Organization.cs @@ -51,7 +51,6 @@ public class Organization : ITableObject, IStorableSubscriber, IRevisable, public short? MaxCollections { get; set; } public bool UsePolicies { get; set; } public bool UseSso { get; set; } - public bool UseOrganizationDomains { get; set; } public bool UseKeyConnector { get; set; } public bool UseScim { get; set; } public bool UseGroups { get; set; } @@ -114,6 +113,7 @@ public class Organization : ITableObject, IStorableSubscriber, IRevisable, /// Risk Insights is a reporting feature that provides insights into the security of an organization's vault. /// public bool UseRiskInsights { get; set; } + public bool UseOrganizationDomains { get; set; } public void SetNewId() { diff --git a/src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserOrganizationDetails.cs b/src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserOrganizationDetails.cs index eba9634bda..634215ced2 100644 --- a/src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserOrganizationDetails.cs +++ b/src/Core/AdminConsole/Models/Data/Organizations/OrganizationUsers/OrganizationUserOrganizationDetails.cs @@ -14,7 +14,6 @@ public class OrganizationUserOrganizationDetails public string Name { get; set; } public bool UsePolicies { get; set; } public bool UseSso { get; set; } - public bool UseOrganizationDomains { get; set; } public bool UseKeyConnector { get; set; } public bool UseScim { get; set; } public bool UseGroups { get; set; } @@ -60,4 +59,5 @@ public class OrganizationUserOrganizationDetails public bool LimitItemDeletion { get; set; } public bool AllowAdminAccessToAllCollectionItems { get; set; } public bool UseRiskInsights { get; set; } + public bool UseOrganizationDomains { get; set; } } diff --git a/src/Core/AdminConsole/OrganizationFeatures/Organizations/CloudOrganizationSignUpCommand.cs b/src/Core/AdminConsole/OrganizationFeatures/Organizations/CloudOrganizationSignUpCommand.cs index c5c8c7cff2..7449628ed0 100644 --- a/src/Core/AdminConsole/OrganizationFeatures/Organizations/CloudOrganizationSignUpCommand.cs +++ b/src/Core/AdminConsole/OrganizationFeatures/Organizations/CloudOrganizationSignUpCommand.cs @@ -82,7 +82,6 @@ public class CloudOrganizationSignUpCommand( (short?)null : (short)(plan.PasswordManager.BaseStorageGb.Value + signup.AdditionalStorageGb), UsePolicies = plan.HasPolicies, UseSso = plan.HasSso, - UseOrganizationDomains = plan.HasOrganizationDomains, UseGroups = plan.HasGroups, UseEvents = plan.HasEvents, UseDirectory = plan.HasDirectory, @@ -105,7 +104,8 @@ public class CloudOrganizationSignUpCommand( RevisionDate = DateTime.UtcNow, Status = OrganizationStatusType.Created, UsePasswordManager = true, - UseSecretsManager = signup.UseSecretsManager + UseSecretsManager = signup.UseSecretsManager, + UseOrganizationDomains = plan.HasOrganizationDomains, }; if (signup.UseSecretsManager)