Files
server/src/Core/Models/Api/Response/ProfileOrganizationResponseModel.cs

72 lines
3.2 KiB
C#
Raw Normal View History

2017-03-06 20:51:13 -05:00
using Bit.Core.Enums;
using Bit.Core.Models.Data;
using Bit.Core.Utilities;
2017-03-08 21:55:08 -05:00
namespace Bit.Core.Models.Api
2017-03-06 20:51:13 -05:00
{
public class ProfileOrganizationResponseModel : ResponseModel
{
public ProfileOrganizationResponseModel(OrganizationUserOrganizationDetails organization)
: base("profileOrganization")
{
Id = organization.OrganizationId.ToString();
Name = organization.Name;
2020-01-15 15:17:32 -05:00
UsePolicies = organization.UsePolicies;
UseSso = organization.UseSso;
2017-05-08 14:22:40 -04:00
UseGroups = organization.UseGroups;
2017-05-20 15:31:16 -04:00
UseDirectory = organization.UseDirectory;
2017-12-14 15:48:44 -05:00
UseEvents = organization.UseEvents;
2017-07-07 14:08:30 -04:00
UseTotp = organization.UseTotp;
2018-04-02 17:15:20 -04:00
Use2fa = organization.Use2fa;
2019-03-02 15:09:33 -05:00
UseApi = organization.UseApi;
UseResetPassword = organization.UseResetPassword;
UsersGetPremium = organization.UsersGetPremium;
2019-03-01 09:33:23 -05:00
SelfHost = organization.SelfHost;
2017-05-08 14:22:40 -04:00
Seats = organization.Seats;
MaxCollections = organization.MaxCollections;
2017-07-07 14:08:30 -04:00
MaxStorageGb = organization.MaxStorageGb;
2017-03-06 20:51:13 -05:00
Key = organization.Key;
HasPublicAndPrivateKeys = organization.PublicKey != null && organization.PrivateKey != null;
2017-03-06 20:51:13 -05:00
Status = organization.Status;
2017-03-25 21:21:38 -04:00
Type = organization.Type;
2017-04-11 15:57:13 -04:00
Enabled = organization.Enabled;
SsoBound = !string.IsNullOrWhiteSpace(organization.SsoExternalId);
Identifier = organization.Identifier;
Permissions = CoreHelpers.LoadClassFromJsonData<Permissions>(organization.Permissions);
ResetPasswordEnrolled = organization.ResetPasswordKey != null;
UserId = organization.UserId?.ToString();
2021-06-30 09:35:26 +02:00
ProviderId = organization.ProviderId?.ToString();
ProviderName = organization.ProviderName;
2017-03-06 20:51:13 -05:00
}
public string Id { get; set; }
public string Name { get; set; }
2020-01-15 15:17:32 -05:00
public bool UsePolicies { get; set; }
public bool UseSso { get; set; }
2017-05-08 14:22:40 -04:00
public bool UseGroups { get; set; }
2017-05-20 15:31:16 -04:00
public bool UseDirectory { get; set; }
2017-12-14 15:48:44 -05:00
public bool UseEvents { get; set; }
2017-07-07 14:08:30 -04:00
public bool UseTotp { get; set; }
2018-04-02 17:15:20 -04:00
public bool Use2fa { get; set; }
2019-03-02 15:09:33 -05:00
public bool UseApi { get; set; }
public bool UseResetPassword { get; set; }
public bool UseBusinessPortal => UsePolicies || UseSso; // TODO add events if needed
public bool UsersGetPremium { get; set; }
2019-03-01 09:33:23 -05:00
public bool SelfHost { get; set; }
2017-05-08 14:22:40 -04:00
public int Seats { get; set; }
public int MaxCollections { get; set; }
2017-07-07 14:08:30 -04:00
public short? MaxStorageGb { get; set; }
2017-03-06 20:51:13 -05:00
public string Key { get; set; }
public OrganizationUserStatusType Status { get; set; }
2017-03-25 16:34:30 -04:00
public OrganizationUserType Type { get; set; }
2017-04-11 15:57:13 -04:00
public bool Enabled { get; set; }
public bool SsoBound { get; set; }
public string Identifier { get; set; }
public Permissions Permissions { get; set; }
public bool ResetPasswordEnrolled { get; set; }
public string UserId { get; set; }
public bool HasPublicAndPrivateKeys { get; set; }
2021-06-30 09:35:26 +02:00
public string ProviderId { get; set; }
public string ProviderName { get; set; }
2017-03-06 20:51:13 -05:00
}
}