mirror of
https://github.com/bitwarden/server.git
synced 2025-04-21 04:55:08 -05:00
WIP
This commit is contained in:
parent
ef207e5ec6
commit
f752050d2b
@ -1,204 +1,198 @@
|
|||||||
/* Introduce new column 'UseAdminSponsoredFamilies' not nullable with default of 0 */
|
|
||||||
ALTER TABLE [dbo].[Organization] ADD [UseAdminSponsoredFamilies] bit NOT NULL CONSTRAINT [DF_Organization_UseAdminSponsoredFamilies] default (0)
|
ALTER TABLE [dbo].[Organization] ADD [UseAdminSponsoredFamilies] bit NOT NULL CONSTRAINT [DF_Organization_UseAdminSponsoredFamilies] default (0)
|
||||||
GO
|
GO
|
||||||
|
|
||||||
/* Add UseAdminSponsoredFamilies as a column to Organization_create */
|
|
||||||
CREATE OR ALTER PROCEDURE [dbo].[Organization_Create]
|
CREATE OR ALTER PROCEDURE [dbo].[Organization_Create]
|
||||||
@Id UNIQUEIDENTIFIER OUTPUT,
|
@Id UNIQUEIDENTIFIER OUTPUT,
|
||||||
@Identifier NVARCHAR(50),
|
@Identifier NVARCHAR(50),
|
||||||
@Name NVARCHAR(50),
|
@Name NVARCHAR(50),
|
||||||
@BusinessName NVARCHAR(50),
|
@BusinessName NVARCHAR(50),
|
||||||
@BusinessAddress1 NVARCHAR(50),
|
@BusinessAddress1 NVARCHAR(50),
|
||||||
@BusinessAddress2 NVARCHAR(50),
|
@BusinessAddress2 NVARCHAR(50),
|
||||||
@BusinessAddress3 NVARCHAR(50),
|
@BusinessAddress3 NVARCHAR(50),
|
||||||
@BusinessCountry VARCHAR(2),
|
@BusinessCountry VARCHAR(2),
|
||||||
@BusinessTaxNumber NVARCHAR(30),
|
@BusinessTaxNumber NVARCHAR(30),
|
||||||
@BillingEmail NVARCHAR(256),
|
@BillingEmail NVARCHAR(256),
|
||||||
@Plan NVARCHAR(50),
|
@Plan NVARCHAR(50),
|
||||||
@PlanType TINYINT,
|
@PlanType TINYINT,
|
||||||
@Seats INT,
|
@Seats INT,
|
||||||
@MaxCollections SMALLINT,
|
@MaxCollections SMALLINT,
|
||||||
@UsePolicies BIT,
|
@UsePolicies BIT,
|
||||||
@UseSso BIT,
|
@UseSso BIT,
|
||||||
@UseGroups BIT,
|
@UseGroups BIT,
|
||||||
@UseDirectory BIT,
|
@UseDirectory BIT,
|
||||||
@UseEvents BIT,
|
@UseEvents BIT,
|
||||||
@UseTotp BIT,
|
@UseTotp BIT,
|
||||||
@Use2fa BIT,
|
@Use2fa BIT,
|
||||||
@UseApi BIT,
|
@UseApi BIT,
|
||||||
@UseResetPassword BIT,
|
@UseResetPassword BIT,
|
||||||
@SelfHost BIT,
|
@SelfHost BIT,
|
||||||
@UsersGetPremium BIT,
|
@UsersGetPremium BIT,
|
||||||
@Storage BIGINT,
|
@Storage BIGINT,
|
||||||
@MaxStorageGb SMALLINT,
|
@MaxStorageGb SMALLINT,
|
||||||
@Gateway TINYINT,
|
@Gateway TINYINT,
|
||||||
@GatewayCustomerId VARCHAR(50),
|
@GatewayCustomerId VARCHAR(50),
|
||||||
@GatewaySubscriptionId VARCHAR(50),
|
@GatewaySubscriptionId VARCHAR(50),
|
||||||
@ReferenceData VARCHAR(MAX),
|
@ReferenceData VARCHAR(MAX),
|
||||||
@Enabled BIT,
|
@Enabled BIT,
|
||||||
@LicenseKey VARCHAR(100),
|
@LicenseKey VARCHAR(100),
|
||||||
@PublicKey VARCHAR(MAX),
|
@PublicKey VARCHAR(MAX),
|
||||||
@PrivateKey VARCHAR(MAX),
|
@PrivateKey VARCHAR(MAX),
|
||||||
@TwoFactorProviders NVARCHAR(MAX),
|
@TwoFactorProviders NVARCHAR(MAX),
|
||||||
@ExpirationDate DATETIME2(7),
|
@ExpirationDate DATETIME2(7),
|
||||||
@CreationDate DATETIME2(7),
|
@CreationDate DATETIME2(7),
|
||||||
@RevisionDate DATETIME2(7),
|
@RevisionDate DATETIME2(7),
|
||||||
@OwnersNotifiedOfAutoscaling DATETIME2(7),
|
@OwnersNotifiedOfAutoscaling DATETIME2(7),
|
||||||
@MaxAutoscaleSeats INT,
|
@MaxAutoscaleSeats INT,
|
||||||
@UseKeyConnector BIT = 0,
|
@UseKeyConnector BIT = 0,
|
||||||
@UseScim BIT = 0,
|
@UseScim BIT = 0,
|
||||||
@UseCustomPermissions BIT = 0,
|
@UseCustomPermissions BIT = 0,
|
||||||
@UseSecretsManager BIT = 0,
|
@UseSecretsManager BIT = 0,
|
||||||
@Status TINYINT = 0,
|
@Status TINYINT = 0,
|
||||||
@UsePasswordManager BIT = 1,
|
@UsePasswordManager BIT = 1,
|
||||||
@SmSeats INT = null,
|
@SmSeats INT = null,
|
||||||
@SmServiceAccounts INT = null,
|
@SmServiceAccounts INT = null,
|
||||||
@MaxAutoscaleSmSeats INT= null,
|
@MaxAutoscaleSmSeats INT= null,
|
||||||
@MaxAutoscaleSmServiceAccounts INT = null,
|
@MaxAutoscaleSmServiceAccounts INT = null,
|
||||||
@SecretsManagerBeta BIT = 0,
|
@SecretsManagerBeta BIT = 0,
|
||||||
@LimitCollectionCreationDeletion BIT = NULL, -- Deprecated https://bitwarden.atlassian.net/browse/PM-10863
|
@LimitCollectionCreation BIT = NULL,
|
||||||
@LimitCollectionCreation BIT = NULL,
|
@LimitCollectionDeletion BIT = NULL,
|
||||||
@LimitCollectionDeletion BIT = NULL,
|
@AllowAdminAccessToAllCollectionItems BIT = 0,
|
||||||
@AllowAdminAccessToAllCollectionItems BIT = 0,
|
@UseRiskInsights BIT = 0,
|
||||||
@UseRiskInsights BIT = 0,
|
@UseAdminSponsoredFamilies BIT = 0,
|
||||||
@UseAdminSponsoredFamilies BIT = 0
|
@LimitItemDeletion BIT = 0
|
||||||
AS
|
AS
|
||||||
BEGIN
|
BEGIN
|
||||||
SET NOCOUNT ON
|
SET NOCOUNT ON
|
||||||
|
|
||||||
SET @LimitCollectionCreation = COALESCE(@LimitCollectionCreation, @LimitCollectionCreationDeletion, 0);
|
INSERT INTO [dbo].[Organization]
|
||||||
SET @LimitCollectionDeletion = COALESCE(@LimitCollectionDeletion, @LimitCollectionCreationDeletion, 0);
|
|
||||||
|
|
||||||
INSERT INTO [dbo].[Organization]
|
|
||||||
(
|
|
||||||
[Id],
|
|
||||||
[Identifier],
|
|
||||||
[Name],
|
|
||||||
[BusinessName],
|
|
||||||
[BusinessAddress1],
|
|
||||||
[BusinessAddress2],
|
|
||||||
[BusinessAddress3],
|
|
||||||
[BusinessCountry],
|
|
||||||
[BusinessTaxNumber],
|
|
||||||
[BillingEmail],
|
|
||||||
[Plan],
|
|
||||||
[PlanType],
|
|
||||||
[Seats],
|
|
||||||
[MaxCollections],
|
|
||||||
[UsePolicies],
|
|
||||||
[UseSso],
|
|
||||||
[UseGroups],
|
|
||||||
[UseDirectory],
|
|
||||||
[UseEvents],
|
|
||||||
[UseTotp],
|
|
||||||
[Use2fa],
|
|
||||||
[UseApi],
|
|
||||||
[UseResetPassword],
|
|
||||||
[SelfHost],
|
|
||||||
[UsersGetPremium],
|
|
||||||
[Storage],
|
|
||||||
[MaxStorageGb],
|
|
||||||
[Gateway],
|
|
||||||
[GatewayCustomerId],
|
|
||||||
[GatewaySubscriptionId],
|
|
||||||
[ReferenceData],
|
|
||||||
[Enabled],
|
|
||||||
[LicenseKey],
|
|
||||||
[PublicKey],
|
|
||||||
[PrivateKey],
|
|
||||||
[TwoFactorProviders],
|
|
||||||
[ExpirationDate],
|
|
||||||
[CreationDate],
|
|
||||||
[RevisionDate],
|
|
||||||
[OwnersNotifiedOfAutoscaling],
|
|
||||||
[MaxAutoscaleSeats],
|
|
||||||
[UseKeyConnector],
|
|
||||||
[UseScim],
|
|
||||||
[UseCustomPermissions],
|
|
||||||
[UseSecretsManager],
|
|
||||||
[Status],
|
|
||||||
[UsePasswordManager],
|
|
||||||
[SmSeats],
|
|
||||||
[SmServiceAccounts],
|
|
||||||
[MaxAutoscaleSmSeats],
|
|
||||||
[MaxAutoscaleSmServiceAccounts],
|
|
||||||
[SecretsManagerBeta],
|
|
||||||
[LimitCollectionCreationDeletion], -- Deprecated https://bitwarden.atlassian.net/browse/PM-10863
|
|
||||||
[LimitCollectionCreation],
|
|
||||||
[LimitCollectionDeletion],
|
|
||||||
[AllowAdminAccessToAllCollectionItems],
|
|
||||||
[UseRiskInsights],
|
|
||||||
[UseAdminSponsoredFamilies]
|
|
||||||
)
|
|
||||||
VALUES
|
|
||||||
(
|
(
|
||||||
@Id,
|
[Id],
|
||||||
@Identifier,
|
[Identifier],
|
||||||
@Name,
|
[Name],
|
||||||
@BusinessName,
|
[BusinessName],
|
||||||
@BusinessAddress1,
|
[BusinessAddress1],
|
||||||
@BusinessAddress2,
|
[BusinessAddress2],
|
||||||
@BusinessAddress3,
|
[BusinessAddress3],
|
||||||
@BusinessCountry,
|
[BusinessCountry],
|
||||||
@BusinessTaxNumber,
|
[BusinessTaxNumber],
|
||||||
@BillingEmail,
|
[BillingEmail],
|
||||||
@Plan,
|
[Plan],
|
||||||
@PlanType,
|
[PlanType],
|
||||||
@Seats,
|
[Seats],
|
||||||
@MaxCollections,
|
[MaxCollections],
|
||||||
@UsePolicies,
|
[UsePolicies],
|
||||||
@UseSso,
|
[UseSso],
|
||||||
@UseGroups,
|
[UseGroups],
|
||||||
@UseDirectory,
|
[UseDirectory],
|
||||||
@UseEvents,
|
[UseEvents],
|
||||||
@UseTotp,
|
[UseTotp],
|
||||||
@Use2fa,
|
[Use2fa],
|
||||||
@UseApi,
|
[UseApi],
|
||||||
@UseResetPassword,
|
[UseResetPassword],
|
||||||
@SelfHost,
|
[SelfHost],
|
||||||
@UsersGetPremium,
|
[UsersGetPremium],
|
||||||
@Storage,
|
[Storage],
|
||||||
@MaxStorageGb,
|
[MaxStorageGb],
|
||||||
@Gateway,
|
[Gateway],
|
||||||
@GatewayCustomerId,
|
[GatewayCustomerId],
|
||||||
@GatewaySubscriptionId,
|
[GatewaySubscriptionId],
|
||||||
@ReferenceData,
|
[ReferenceData],
|
||||||
@Enabled,
|
[Enabled],
|
||||||
@LicenseKey,
|
[LicenseKey],
|
||||||
@PublicKey,
|
[PublicKey],
|
||||||
@PrivateKey,
|
[PrivateKey],
|
||||||
@TwoFactorProviders,
|
[TwoFactorProviders],
|
||||||
@ExpirationDate,
|
[ExpirationDate],
|
||||||
@CreationDate,
|
[CreationDate],
|
||||||
@RevisionDate,
|
[RevisionDate],
|
||||||
@OwnersNotifiedOfAutoscaling,
|
[OwnersNotifiedOfAutoscaling],
|
||||||
@MaxAutoscaleSeats,
|
[MaxAutoscaleSeats],
|
||||||
@UseKeyConnector,
|
[UseKeyConnector],
|
||||||
@UseScim,
|
[UseScim],
|
||||||
@UseCustomPermissions,
|
[UseCustomPermissions],
|
||||||
@UseSecretsManager,
|
[UseSecretsManager],
|
||||||
@Status,
|
[Status],
|
||||||
@UsePasswordManager,
|
[UsePasswordManager],
|
||||||
@SmSeats,
|
[SmSeats],
|
||||||
@SmServiceAccounts,
|
[SmServiceAccounts],
|
||||||
@MaxAutoscaleSmSeats,
|
[MaxAutoscaleSmSeats],
|
||||||
@MaxAutoscaleSmServiceAccounts,
|
[MaxAutoscaleSmServiceAccounts],
|
||||||
@SecretsManagerBeta,
|
[SecretsManagerBeta],
|
||||||
COALESCE(@LimitCollectionCreation, @LimitCollectionDeletion, 0), -- Deprecated https://bitwarden.atlassian.net/browse/PM-10863)
|
[LimitCollectionCreation],
|
||||||
@LimitCollectionCreation,
|
[LimitCollectionDeletion],
|
||||||
@LimitCollectionDeletion,
|
[AllowAdminAccessToAllCollectionItems],
|
||||||
@AllowAdminAccessToAllCollectionItems,
|
[UseRiskInsights],
|
||||||
@UseRiskInsights,
|
[UseAdminSponsoredFamilies],
|
||||||
@UseAdminSponsoredFamilies
|
[LimitItemDeletion]
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
@Id,
|
||||||
|
@Identifier,
|
||||||
|
@Name,
|
||||||
|
@BusinessName,
|
||||||
|
@BusinessAddress1,
|
||||||
|
@BusinessAddress2,
|
||||||
|
@BusinessAddress3,
|
||||||
|
@BusinessCountry,
|
||||||
|
@BusinessTaxNumber,
|
||||||
|
@BillingEmail,
|
||||||
|
@Plan,
|
||||||
|
@PlanType,
|
||||||
|
@Seats,
|
||||||
|
@MaxCollections,
|
||||||
|
@UsePolicies,
|
||||||
|
@UseSso,
|
||||||
|
@UseGroups,
|
||||||
|
@UseDirectory,
|
||||||
|
@UseEvents,
|
||||||
|
@UseTotp,
|
||||||
|
@Use2fa,
|
||||||
|
@UseApi,
|
||||||
|
@UseResetPassword,
|
||||||
|
@SelfHost,
|
||||||
|
@UsersGetPremium,
|
||||||
|
@Storage,
|
||||||
|
@MaxStorageGb,
|
||||||
|
@Gateway,
|
||||||
|
@GatewayCustomerId,
|
||||||
|
@GatewaySubscriptionId,
|
||||||
|
@ReferenceData,
|
||||||
|
@Enabled,
|
||||||
|
@LicenseKey,
|
||||||
|
@PublicKey,
|
||||||
|
@PrivateKey,
|
||||||
|
@TwoFactorProviders,
|
||||||
|
@ExpirationDate,
|
||||||
|
@CreationDate,
|
||||||
|
@RevisionDate,
|
||||||
|
@OwnersNotifiedOfAutoscaling,
|
||||||
|
@MaxAutoscaleSeats,
|
||||||
|
@UseKeyConnector,
|
||||||
|
@UseScim,
|
||||||
|
@UseCustomPermissions,
|
||||||
|
@UseSecretsManager,
|
||||||
|
@Status,
|
||||||
|
@UsePasswordManager,
|
||||||
|
@SmSeats,
|
||||||
|
@SmServiceAccounts,
|
||||||
|
@MaxAutoscaleSmSeats,
|
||||||
|
@MaxAutoscaleSmServiceAccounts,
|
||||||
|
@SecretsManagerBeta,
|
||||||
|
@LimitCollectionCreation,
|
||||||
|
@LimitCollectionDeletion,
|
||||||
|
@AllowAdminAccessToAllCollectionItems,
|
||||||
|
@UseRiskInsights,
|
||||||
|
@UseAdminSponsoredFamilies,
|
||||||
|
@LimitItemDeletion
|
||||||
)
|
)
|
||||||
END
|
END
|
||||||
GO
|
GO
|
||||||
|
|
||||||
/* Add UseRiskInsights to Organization_readAbilities */
|
CREATE OR ALTER PROCEDURE [dbo].[Organization_ReadAbilities]
|
||||||
CREATE OR ALTER PROCEDURE [dbo].[Organization_ReadAbilities]
|
AS
|
||||||
AS
|
|
||||||
BEGIN
|
BEGIN
|
||||||
SET NOCOUNT ON
|
SET NOCOUNT ON
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
[Id],
|
[Id],
|
||||||
@ -210,91 +204,87 @@ SELECT
|
|||||||
ELSE
|
ELSE
|
||||||
0
|
0
|
||||||
END AS [Using2fa],
|
END AS [Using2fa],
|
||||||
[UsersGetPremium],
|
[UsersGetPremium],
|
||||||
[UseCustomPermissions],
|
[UseCustomPermissions],
|
||||||
[UseSso],
|
[UseSso],
|
||||||
[UseKeyConnector],
|
[UseKeyConnector],
|
||||||
[UseScim],
|
[UseScim],
|
||||||
[UseResetPassword],
|
[UseResetPassword],
|
||||||
[UsePolicies],
|
[UsePolicies],
|
||||||
[Enabled],
|
[Enabled],
|
||||||
[LimitCollectionCreationDeletion], -- Deprecated https://bitwarden.atlassian.net/browse/PM-10863
|
[LimitCollectionCreation],
|
||||||
[LimitCollectionCreation],
|
[LimitCollectionDeletion],
|
||||||
[LimitCollectionDeletion],
|
[AllowAdminAccessToAllCollectionItems],
|
||||||
[AllowAdminAccessToAllCollectionItems],
|
[UseRiskInsights],
|
||||||
[UseRiskInsights],
|
[UseAdminSponsoredFamilies],
|
||||||
[UseAdminSponsoredFamilies]
|
[LimitItemDeletion]
|
||||||
FROM
|
FROM
|
||||||
[dbo].[Organization]
|
[dbo].[Organization]
|
||||||
END
|
END
|
||||||
GO
|
GO
|
||||||
|
|
||||||
/* Add UseRiskInsights to Organization_Update */
|
CREATE OR ALTER PROCEDURE [dbo].[Organization_Update]
|
||||||
CREATE OR ALTER PROCEDURE [dbo].[Organization_Update]
|
@Id UNIQUEIDENTIFIER,
|
||||||
@Id UNIQUEIDENTIFIER,
|
@Identifier NVARCHAR(50),
|
||||||
@Identifier NVARCHAR(50),
|
@Name NVARCHAR(50),
|
||||||
@Name NVARCHAR(50),
|
@BusinessName NVARCHAR(50),
|
||||||
@BusinessName NVARCHAR(50),
|
@BusinessAddress1 NVARCHAR(50),
|
||||||
@BusinessAddress1 NVARCHAR(50),
|
@BusinessAddress2 NVARCHAR(50),
|
||||||
@BusinessAddress2 NVARCHAR(50),
|
@BusinessAddress3 NVARCHAR(50),
|
||||||
@BusinessAddress3 NVARCHAR(50),
|
@BusinessCountry VARCHAR(2),
|
||||||
@BusinessCountry VARCHAR(2),
|
@BusinessTaxNumber NVARCHAR(30),
|
||||||
@BusinessTaxNumber NVARCHAR(30),
|
@BillingEmail NVARCHAR(256),
|
||||||
@BillingEmail NVARCHAR(256),
|
@Plan NVARCHAR(50),
|
||||||
@Plan NVARCHAR(50),
|
@PlanType TINYINT,
|
||||||
@PlanType TINYINT,
|
@Seats INT,
|
||||||
@Seats INT,
|
@MaxCollections SMALLINT,
|
||||||
@MaxCollections SMALLINT,
|
@UsePolicies BIT,
|
||||||
@UsePolicies BIT,
|
@UseSso BIT,
|
||||||
@UseSso BIT,
|
@UseGroups BIT,
|
||||||
@UseGroups BIT,
|
@UseDirectory BIT,
|
||||||
@UseDirectory BIT,
|
@UseEvents BIT,
|
||||||
@UseEvents BIT,
|
@UseTotp BIT,
|
||||||
@UseTotp BIT,
|
@Use2fa BIT,
|
||||||
@Use2fa BIT,
|
@UseApi BIT,
|
||||||
@UseApi BIT,
|
@UseResetPassword BIT,
|
||||||
@UseResetPassword BIT,
|
@SelfHost BIT,
|
||||||
@SelfHost BIT,
|
@UsersGetPremium BIT,
|
||||||
@UsersGetPremium BIT,
|
@Storage BIGINT,
|
||||||
@Storage BIGINT,
|
@MaxStorageGb SMALLINT,
|
||||||
@MaxStorageGb SMALLINT,
|
@Gateway TINYINT,
|
||||||
@Gateway TINYINT,
|
@GatewayCustomerId VARCHAR(50),
|
||||||
@GatewayCustomerId VARCHAR(50),
|
@GatewaySubscriptionId VARCHAR(50),
|
||||||
@GatewaySubscriptionId VARCHAR(50),
|
@ReferenceData VARCHAR(MAX),
|
||||||
@ReferenceData VARCHAR(MAX),
|
@Enabled BIT,
|
||||||
@Enabled BIT,
|
@LicenseKey VARCHAR(100),
|
||||||
@LicenseKey VARCHAR(100),
|
@PublicKey VARCHAR(MAX),
|
||||||
@PublicKey VARCHAR(MAX),
|
@PrivateKey VARCHAR(MAX),
|
||||||
@PrivateKey VARCHAR(MAX),
|
@TwoFactorProviders NVARCHAR(MAX),
|
||||||
@TwoFactorProviders NVARCHAR(MAX),
|
@ExpirationDate DATETIME2(7),
|
||||||
@ExpirationDate DATETIME2(7),
|
@CreationDate DATETIME2(7),
|
||||||
@CreationDate DATETIME2(7),
|
@RevisionDate DATETIME2(7),
|
||||||
@RevisionDate DATETIME2(7),
|
@OwnersNotifiedOfAutoscaling DATETIME2(7),
|
||||||
@OwnersNotifiedOfAutoscaling DATETIME2(7),
|
@MaxAutoscaleSeats INT,
|
||||||
@MaxAutoscaleSeats INT,
|
@UseKeyConnector BIT = 0,
|
||||||
@UseKeyConnector BIT = 0,
|
@UseScim BIT = 0,
|
||||||
@UseScim BIT = 0,
|
@UseCustomPermissions BIT = 0,
|
||||||
@UseCustomPermissions BIT = 0,
|
@UseSecretsManager BIT = 0,
|
||||||
@UseSecretsManager BIT = 0,
|
@Status TINYINT = 0,
|
||||||
@Status TINYINT = 0,
|
@UsePasswordManager BIT = 1,
|
||||||
@UsePasswordManager BIT = 1,
|
@SmSeats INT = null,
|
||||||
@SmSeats INT = null,
|
@SmServiceAccounts INT = null,
|
||||||
@SmServiceAccounts INT = null,
|
@MaxAutoscaleSmSeats INT = null,
|
||||||
@MaxAutoscaleSmSeats INT = null,
|
@MaxAutoscaleSmServiceAccounts INT = null,
|
||||||
@MaxAutoscaleSmServiceAccounts INT = null,
|
@SecretsManagerBeta BIT = 0,
|
||||||
@SecretsManagerBeta BIT = 0,
|
@LimitCollectionCreation BIT = null,
|
||||||
@LimitCollectionCreationDeletion BIT = null, -- Deprecated https://bitwarden.atlassian.net/browse/PM-10863
|
@LimitCollectionDeletion BIT = null,
|
||||||
@LimitCollectionCreation BIT = null,
|
@AllowAdminAccessToAllCollectionItems BIT = 0,
|
||||||
@LimitCollectionDeletion BIT = null,
|
@UseRiskInsights BIT = 0,
|
||||||
@AllowAdminAccessToAllCollectionItems BIT = 0,
|
@UseAdminSponsoredFamilies BIT = 0,
|
||||||
@UseRiskInsights BIT = 0,
|
@LimitItemDeletion BIT = 0
|
||||||
@UseAdminSponsoredFamilies BIT = 0
|
AS
|
||||||
AS
|
|
||||||
BEGIN
|
BEGIN
|
||||||
SET NOCOUNT ON
|
SET NOCOUNT ON
|
||||||
|
|
||||||
SET @LimitCollectionCreation = COALESCE(@LimitCollectionCreation, @LimitCollectionCreationDeletion, 0);
|
|
||||||
SET @LimitCollectionDeletion = COALESCE(@LimitCollectionDeletion, @LimitCollectionCreationDeletion, 0);
|
|
||||||
|
|
||||||
UPDATE
|
UPDATE
|
||||||
[dbo].[Organization]
|
[dbo].[Organization]
|
||||||
@ -350,12 +340,11 @@ SET
|
|||||||
[MaxAutoscaleSmSeats] = @MaxAutoscaleSmSeats,
|
[MaxAutoscaleSmSeats] = @MaxAutoscaleSmSeats,
|
||||||
[MaxAutoscaleSmServiceAccounts] = @MaxAutoscaleSmServiceAccounts,
|
[MaxAutoscaleSmServiceAccounts] = @MaxAutoscaleSmServiceAccounts,
|
||||||
[SecretsManagerBeta] = @SecretsManagerBeta,
|
[SecretsManagerBeta] = @SecretsManagerBeta,
|
||||||
[LimitCollectionCreationDeletion] = COALESCE(@LimitCollectionCreation, @LimitCollectionDeletion, 0),
|
|
||||||
[LimitCollectionCreation] = @LimitCollectionCreation,
|
[LimitCollectionCreation] = @LimitCollectionCreation,
|
||||||
[LimitCollectionDeletion] = @LimitCollectionDeletion,
|
[LimitCollectionDeletion] = @LimitCollectionDeletion,
|
||||||
[AllowAdminAccessToAllCollectionItems] = @AllowAdminAccessToAllCollectionItems,
|
[AllowAdminAccessToAllCollectionItems] = @AllowAdminAccessToAllCollectionItems,
|
||||||
[UseRiskInsights] = @UseRiskInsights,
|
[UseRiskInsights] = @UseRiskInsights,
|
||||||
[UseAdminSponsoredFamilies] = @UseAdminSponsoredFamilies
|
[LimitItemDeletion] = @LimitItemDeletion
|
||||||
WHERE
|
WHERE
|
||||||
[Id] = @Id
|
[Id] = @Id
|
||||||
END
|
END
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
/* Alter view to include UseAdminSponsoredFamilies */
|
|
||||||
CREATE OR ALTER VIEW [dbo].[OrganizationUserOrganizationDetailsView]
|
CREATE OR ALTER VIEW [dbo].[OrganizationUserOrganizationDetailsView]
|
||||||
AS
|
AS
|
||||||
SELECT
|
SELECT
|
||||||
OU.[UserId],
|
OU.[UserId],
|
||||||
OU.[OrganizationId],
|
OU.[OrganizationId],
|
||||||
@ -47,12 +46,12 @@ SELECT
|
|||||||
O.[UsePasswordManager],
|
O.[UsePasswordManager],
|
||||||
O.[SmSeats],
|
O.[SmSeats],
|
||||||
O.[SmServiceAccounts],
|
O.[SmServiceAccounts],
|
||||||
O.[LimitCollectionCreationDeletion], -- Deprecated https://bitwarden.atlassian.net/browse/PM-10863
|
|
||||||
O.[LimitCollectionCreation],
|
O.[LimitCollectionCreation],
|
||||||
O.[LimitCollectionDeletion],
|
O.[LimitCollectionDeletion],
|
||||||
O.[AllowAdminAccessToAllCollectionItems],
|
O.[AllowAdminAccessToAllCollectionItems],
|
||||||
O.[UseRiskInsights],
|
O.[UseRiskInsights],
|
||||||
O.[UseAdminSponsoredFamilies]
|
O.[UseAdminSponsoredFamilies],
|
||||||
|
O.[LimitItemDeletion]
|
||||||
FROM
|
FROM
|
||||||
[dbo].[OrganizationUser] OU
|
[dbo].[OrganizationUser] OU
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
@ -67,11 +66,10 @@ FROM
|
|||||||
[dbo].[SsoConfig] SS ON SS.[OrganizationId] = OU.[OrganizationId]
|
[dbo].[SsoConfig] SS ON SS.[OrganizationId] = OU.[OrganizationId]
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
[dbo].[OrganizationSponsorship] OS ON OS.[SponsoringOrganizationUserID] = OU.[Id]
|
[dbo].[OrganizationSponsorship] OS ON OS.[SponsoringOrganizationUserID] = OU.[Id]
|
||||||
GO
|
GO
|
||||||
|
|
||||||
/* Alter this view to include UseAdminSponsoredFamilies column to the query */
|
|
||||||
CREATE OR ALTER VIEW [dbo].[ProviderUserProviderOrganizationDetailsView]
|
CREATE OR ALTER VIEW [dbo].[ProviderUserProviderOrganizationDetailsView]
|
||||||
AS
|
AS
|
||||||
SELECT
|
SELECT
|
||||||
PU.[UserId],
|
PU.[UserId],
|
||||||
PO.[OrganizationId],
|
PO.[OrganizationId],
|
||||||
@ -104,12 +102,13 @@ SELECT
|
|||||||
PU.[Id] ProviderUserId,
|
PU.[Id] ProviderUserId,
|
||||||
P.[Name] ProviderName,
|
P.[Name] ProviderName,
|
||||||
O.[PlanType],
|
O.[PlanType],
|
||||||
O.[LimitCollectionCreationDeletion], -- Deprecated https://bitwarden.atlassian.net/browse/PM-10863
|
|
||||||
O.[LimitCollectionCreation],
|
O.[LimitCollectionCreation],
|
||||||
O.[LimitCollectionDeletion],
|
O.[LimitCollectionDeletion],
|
||||||
O.[AllowAdminAccessToAllCollectionItems],
|
O.[AllowAdminAccessToAllCollectionItems],
|
||||||
O.[UseRiskInsights],
|
O.[UseRiskInsights],
|
||||||
O.[UseAdminSponsoredFamilies]
|
O.[UseAdminSponsoredFamilies],
|
||||||
|
P.[Type] ProviderType,
|
||||||
|
O.[LimitItemDeletion]
|
||||||
FROM
|
FROM
|
||||||
[dbo].[ProviderUser] PU
|
[dbo].[ProviderUser] PU
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
@ -118,25 +117,25 @@ FROM
|
|||||||
[dbo].[Organization] O ON O.[Id] = PO.[OrganizationId]
|
[dbo].[Organization] O ON O.[Id] = PO.[OrganizationId]
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
[dbo].[Provider] P ON P.[Id] = PU.[ProviderId]
|
[dbo].[Provider] P ON P.[Id] = PU.[ProviderId]
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
|
||||||
--Manually refresh [dbo].[OrganizationUserOrganizationDetailsView]
|
--Manually refresh [dbo].[OrganizationUserOrganizationDetailsView]
|
||||||
IF OBJECT_ID('[dbo].[OrganizationUserOrganizationDetailsView]') IS NOT NULL
|
IF OBJECT_ID('[dbo].[OrganizationUserOrganizationDetailsView]') IS NOT NULL
|
||||||
BEGIN
|
BEGIN
|
||||||
EXECUTE sp_refreshsqlmodule N'[dbo].[OrganizationUserOrganizationDetailsView]';
|
EXECUTE sp_refreshsqlmodule N'[dbo].[OrganizationUserOrganizationDetailsView]';
|
||||||
END
|
END
|
||||||
GO
|
GO
|
||||||
|
|
||||||
--Manually refresh [dbo].[ProviderUserProviderOrganizationDetailsView]
|
--Manually refresh [dbo].[ProviderUserProviderOrganizationDetailsView]
|
||||||
IF OBJECT_ID('[dbo].[ProviderUserProviderOrganizationDetailsView]') IS NOT NULL
|
IF OBJECT_ID('[dbo].[ProviderUserProviderOrganizationDetailsView]') IS NOT NULL
|
||||||
BEGIN
|
BEGIN
|
||||||
EXECUTE sp_refreshsqlmodule N'[dbo].[ProviderUserProviderOrganizationDetailsView]';
|
EXECUTE sp_refreshsqlmodule N'[dbo].[ProviderUserProviderOrganizationDetailsView]';
|
||||||
END
|
END
|
||||||
GO
|
GO
|
||||||
|
|
||||||
--Manually refresh [dbo].[OrganizationView]
|
--Manually refresh [dbo].[OrganizationView]
|
||||||
IF OBJECT_ID('[dbo].[OrganizationView]') IS NOT NULL
|
IF OBJECT_ID('[dbo].[OrganizationView]') IS NOT NULL
|
||||||
BEGIN
|
BEGIN
|
||||||
EXECUTE sp_refreshsqlmodule N'[dbo].[OrganizationView]';
|
EXECUTE sp_refreshsqlmodule N'[dbo].[OrganizationView]';
|
||||||
END
|
END
|
||||||
|
Loading…
x
Reference in New Issue
Block a user