2021-07-08 17:05:32 +02:00
|
|
|
|
using Bit.Core.Enums;
|
|
|
|
|
|
using Bit.Core.Models.Data;
|
2023-01-26 11:51:26 -05:00
|
|
|
|
using Bit.Core.Utilities;
|
2021-07-08 17:05:32 +02:00
|
|
|
|
|
2023-10-19 01:27:56 +10:00
|
|
|
|
namespace Bit.Api.AdminConsole.Models.Response;
|
2022-08-29 16:06:55 -04:00
|
|
|
|
|
2021-07-15 16:37:27 +02:00
|
|
|
|
public class ProfileProviderOrganizationResponseModel : ProfileOrganizationResponseModel
|
2021-07-08 17:05:32 +02:00
|
|
|
|
{
|
2021-07-15 16:37:27 +02:00
|
|
|
|
public ProfileProviderOrganizationResponseModel(ProviderUserOrganizationDetails organization)
|
|
|
|
|
|
: base("profileProviderOrganization")
|
2021-07-08 17:05:32 +02:00
|
|
|
|
{
|
2023-07-14 17:18:26 +02:00
|
|
|
|
Id = organization.OrganizationId;
|
2021-07-08 17:05:32 +02:00
|
|
|
|
Name = organization.Name;
|
|
|
|
|
|
UsePolicies = organization.UsePolicies;
|
|
|
|
|
|
UseSso = organization.UseSso;
|
2021-11-17 11:46:35 +01:00
|
|
|
|
UseKeyConnector = organization.UseKeyConnector;
|
2022-07-14 15:58:48 -04:00
|
|
|
|
UseScim = organization.UseScim;
|
2021-07-08 17:05:32 +02:00
|
|
|
|
UseGroups = organization.UseGroups;
|
|
|
|
|
|
UseDirectory = organization.UseDirectory;
|
|
|
|
|
|
UseEvents = organization.UseEvents;
|
|
|
|
|
|
UseTotp = organization.UseTotp;
|
|
|
|
|
|
Use2fa = organization.Use2fa;
|
|
|
|
|
|
UseApi = organization.UseApi;
|
|
|
|
|
|
UseResetPassword = organization.UseResetPassword;
|
|
|
|
|
|
UsersGetPremium = organization.UsersGetPremium;
|
2022-12-06 09:50:08 +00:00
|
|
|
|
UseCustomPermissions = organization.UseCustomPermissions;
|
2023-03-10 12:52:50 -05:00
|
|
|
|
UseActivateAutofillPolicy = organization.PlanType == PlanType.EnterpriseAnnually ||
|
|
|
|
|
|
organization.PlanType == PlanType.EnterpriseMonthly;
|
2021-07-08 17:05:32 +02:00
|
|
|
|
SelfHost = organization.SelfHost;
|
|
|
|
|
|
Seats = organization.Seats;
|
|
|
|
|
|
MaxCollections = organization.MaxCollections;
|
|
|
|
|
|
MaxStorageGb = organization.MaxStorageGb;
|
|
|
|
|
|
Key = organization.Key;
|
|
|
|
|
|
HasPublicAndPrivateKeys = organization.PublicKey != null && organization.PrivateKey != null;
|
2021-07-15 16:37:27 +02:00
|
|
|
|
Status = OrganizationUserStatusType.Confirmed; // Provider users are always confirmed
|
|
|
|
|
|
Type = OrganizationUserType.Owner; // Provider users behave like Owners
|
2021-07-08 17:05:32 +02:00
|
|
|
|
Enabled = organization.Enabled;
|
2021-07-15 16:37:27 +02:00
|
|
|
|
SsoBound = false;
|
2021-07-08 17:05:32 +02:00
|
|
|
|
Identifier = organization.Identifier;
|
2021-07-15 16:37:27 +02:00
|
|
|
|
Permissions = new Permissions();
|
|
|
|
|
|
ResetPasswordEnrolled = false;
|
2023-07-14 17:18:26 +02:00
|
|
|
|
UserId = organization.UserId;
|
|
|
|
|
|
ProviderId = organization.ProviderId;
|
2021-07-08 17:05:32 +02:00
|
|
|
|
ProviderName = organization.ProviderName;
|
2023-10-17 15:56:35 +01:00
|
|
|
|
PlanProductType = StaticStore.GetPlan(organization.PlanType).Product;
|
2021-07-08 17:05:32 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|