From 367d3f65a6ba2f9a327650f1ecfe8cb517fca8fd Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 2 Apr 2018 17:20:06 -0400 Subject: [PATCH] use2fa org response --- .../OrganizationUserOrganizationDetails.cs | 1 + ...rganizationUserOrganizationDetailsView.sql | 1 + util/Setup/DbScripts/2018-04-02_00_Org2fa.sql | 32 +++++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/src/Core/Models/Data/OrganizationUserOrganizationDetails.cs b/src/Core/Models/Data/OrganizationUserOrganizationDetails.cs index c5bb4ace9..48836a969 100644 --- a/src/Core/Models/Data/OrganizationUserOrganizationDetails.cs +++ b/src/Core/Models/Data/OrganizationUserOrganizationDetails.cs @@ -11,6 +11,7 @@ namespace Bit.Core.Models.Data public bool UseDirectory { get; set; } public bool UseEvents { get; set; } public bool UseTotp { get; set; } + public bool Use2fa { get; set; } public bool SelfHost { get; set; } public bool UsersGetPremium { get; set; } public int Seats { get; set; } diff --git a/src/Sql/dbo/Views/OrganizationUserOrganizationDetailsView.sql b/src/Sql/dbo/Views/OrganizationUserOrganizationDetailsView.sql index 721d095e9..bf8bd6c58 100644 --- a/src/Sql/dbo/Views/OrganizationUserOrganizationDetailsView.sql +++ b/src/Sql/dbo/Views/OrganizationUserOrganizationDetailsView.sql @@ -9,6 +9,7 @@ SELECT O.[UseDirectory], O.[UseEvents], O.[UseTotp], + O.[Use2fa], O.[SelfHost], O.[UsersGetPremium], O.[Seats], diff --git a/util/Setup/DbScripts/2018-04-02_00_Org2fa.sql b/util/Setup/DbScripts/2018-04-02_00_Org2fa.sql index a84acdd76..5d1e86256 100644 --- a/util/Setup/DbScripts/2018-04-02_00_Org2fa.sql +++ b/util/Setup/DbScripts/2018-04-02_00_Org2fa.sql @@ -255,3 +255,35 @@ SELECT FROM [dbo].[Organization] GO + +IF EXISTS(SELECT * FROM sys.views WHERE [Name] = 'OrganizationUserOrganizationDetailsView') +BEGIN + DROP VIEW [dbo].[OrganizationUserOrganizationDetailsView] +END +GO + +CREATE VIEW [dbo].[OrganizationUserOrganizationDetailsView] +AS +SELECT + OU.[UserId], + OU.[OrganizationId], + O.[Name], + O.[Enabled], + O.[UseGroups], + O.[UseDirectory], + O.[UseEvents], + O.[UseTotp], + O.[Use2fa], + O.[SelfHost], + O.[UsersGetPremium], + O.[Seats], + O.[MaxCollections], + O.[MaxStorageGb], + OU.[Key], + OU.[Status], + OU.[Type] +FROM + [dbo].[OrganizationUser] OU +INNER JOIN + [dbo].[Organization] O ON O.[Id] = OU.[OrganizationId] +GO