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

73 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(string str) : base(str) {}
public ProfileOrganizationResponseModel(OrganizationUserOrganizationDetails organization) : this("profileOrganization")
2017-03-06 20:51:13 -05:00
{
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 UsersGetPremium { get; set; }
2019-03-01 09:33:23 -05:00
public bool SelfHost { get; set; }
Postgres & MySql Support For Self-Hosted Installations (#1386) * EF Database Support Init (#1221) * scaffolding for ef support * deleted old postgres repos * added tables to oncreate * updated all the things to .NET 5 * Addition to #1221: Migrated DockerFiles from dotnet/3.1 to 5.0 (#1223) * Migrated DockerFiles from dotnet/3.1 to 5.0 * Migrated SSO/Dockerfile from dotnet 3.1 to 5.0 Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com> * EFDatabaseSupport: Updated links and description in README.md and SETUP.md (#1232) * Updated requirements in README.md * Updated link to documentation of app-secrets * upgraded dotnet version to 5.0 * Ef database support implementation examples (#1265) * mostly finished testing the user repo * finished testing user repo * finished org, user, ssoconfig, and ssouser ef implementations * removed unused prop * fixed a sql file * fixed a spacing issue * fixed a spacing issue * removed extra database creation * refactoring * MsSql => SqlServer * refactoring * code review fixes * build fix * code review * continued attempts to fix the the build * skipped another test * finished all create test * initial pass at several repos * continued building out repos * initial pass at several repos * initial pass at device repo * initial pass at collection repo * initial run of all Entity Framework implementations * signup, signin, create/edit ciphers works * sync working * all web vault pages seem to load with 100% 200s * bulkcopy, folders, and favorites * group and collection management * sso, groups, emergency access, send * get basic creates matching on all repos * got everything building again post merge * removed some IDE config files * cleanup * no more notimplemented methods in the cipher repo * no more not implementeds everywhere * cleaned up schema/navigation properties and fixed tests * removed a sql comment that was written in c# style * fixed build issues from merge * removed unsupported db providers * formatting * code review refactors * naming cleanup for queries * added provider methods * cipher repo cleanup * implemented several missing procedures from the EF implementation surround account revision dates, keys, and storage * fixed the build * added a null check * consolidated some cipher repo methods * formatting fix * cleaned up indentation of queries * removed .idea file * generated postgres migrations * added mysql migrations * formatting * Bug Fixes & Formatting * Formatting * fixed a bug with bulk import when using MySql * code review fixes * fixed the build * implemented new methods * formatting * fixed the build * cleaned up select statements in ef queries * formatting * formatting * formatting Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2021-07-08 12:35:48 -04:00
public int? Seats { get; set; }
public short? 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
}
}