1
0
mirror of https://github.com/bitwarden/server synced 2026-02-28 18:33:51 +00:00

[PM-32131] Add UseMyItems organization ability (#7014)

Purpose: UseMyItems is a new organization ability / plan flag
which is automatically enabled where UsePolicies is enabled,
but can be selectively disabled to disable My Items creation
when the Organization Data Ownership policy is turned on.

- new organization table column with all sprocs and views updated
- data migration to enable the feature for all organizations that already use policies (replicating existing behaviour)
- data and api models updated
- added to organization license file so it can be preserved in self-hosted instances
- note that we don't have a plan feature defined for this yet, so it is set based on UsePolicies to match the migration logic. Billing Team have a ticket to add this
This commit is contained in:
Thomas Rittson
2026-02-25 12:52:28 +10:00
committed by GitHub
parent 8f54ac306c
commit e3c392badb
54 changed files with 22386 additions and 21 deletions

View File

@@ -61,7 +61,8 @@ CREATE PROCEDURE [dbo].[Organization_Create]
@SyncSeats BIT = 0,
@UseAutomaticUserConfirmation BIT = 0,
@UsePhishingBlocker BIT = 0,
@UseDisableSmAdsForUsers BIT = 0
@UseDisableSmAdsForUsers BIT = 0,
@UseMyItems BIT = 0
AS
BEGIN
SET NOCOUNT ON
@@ -131,7 +132,8 @@ BEGIN
[UseAutomaticUserConfirmation],
[UsePhishingBlocker],
[MaxStorageGbIncreased],
[UseDisableSmAdsForUsers]
[UseDisableSmAdsForUsers],
[UseMyItems]
)
VALUES
(
@@ -198,6 +200,7 @@ BEGIN
@UseAutomaticUserConfirmation,
@UsePhishingBlocker,
@MaxStorageGb,
@UseDisableSmAdsForUsers
@UseDisableSmAdsForUsers,
@UseMyItems
);
END

View File

@@ -28,9 +28,10 @@ BEGIN
[LimitItemDeletion],
[UseOrganizationDomains],
[UseAdminSponsoredFamilies],
[UseAutomaticUserConfirmation],
[UseAutomaticUserConfirmation],
[UsePhishingBlocker],
[UseDisableSmAdsForUsers]
[UseDisableSmAdsForUsers],
[UseMyItems]
FROM
[dbo].[Organization]
END

View File

@@ -61,7 +61,8 @@ CREATE PROCEDURE [dbo].[Organization_Update]
@SyncSeats BIT = 0,
@UseAutomaticUserConfirmation BIT = 0,
@UsePhishingBlocker BIT = 0,
@UseDisableSmAdsForUsers BIT = 0
@UseDisableSmAdsForUsers BIT = 0,
@UseMyItems BIT = 0
AS
BEGIN
SET NOCOUNT ON
@@ -131,7 +132,8 @@ BEGIN
[UseAutomaticUserConfirmation] = @UseAutomaticUserConfirmation,
[UsePhishingBlocker] = @UsePhishingBlocker,
[MaxStorageGbIncreased] = @MaxStorageGb,
[UseDisableSmAdsForUsers] = @UseDisableSmAdsForUsers
[UseDisableSmAdsForUsers] = @UseDisableSmAdsForUsers,
[UseMyItems] = @UseMyItems
WHERE
[Id] = @Id;
END

View File

@@ -63,6 +63,7 @@ CREATE TABLE [dbo].[Organization] (
[MaxStorageGbIncreased] SMALLINT NULL,
[UsePhishingBlocker] BIT NOT NULL CONSTRAINT [DF_Organization_UsePhishingBlocker] DEFAULT (0),
[UseDisableSmAdsForUsers] BIT NOT NULL CONSTRAINT [DF_Organization_UseDisableSmAdsForUsers] DEFAULT (0),
[UseMyItems] BIT NOT NULL CONSTRAINT [DF_Organization_UseMyItems] DEFAULT (0),
CONSTRAINT [PK_Organization] PRIMARY KEY CLUSTERED ([Id] ASC)
);

View File

@@ -57,7 +57,8 @@ SELECT
OS.[IsAdminInitiated],
O.[UseAutomaticUserConfirmation],
O.[UsePhishingBlocker],
O.[UseDisableSmAdsForUsers]
O.[UseDisableSmAdsForUsers],
O.[UseMyItems]
FROM
[dbo].[OrganizationUser] OU
LEFT JOIN

View File

@@ -63,6 +63,7 @@ SELECT
[SyncSeats],
[UseAutomaticUserConfirmation],
[UsePhishingBlocker],
[UseDisableSmAdsForUsers]
[UseDisableSmAdsForUsers],
[UseMyItems]
FROM
[dbo].[Organization]

View File

@@ -46,7 +46,8 @@ SELECT
SS.[Enabled] SsoEnabled,
SS.[Data] SsoConfig,
O.[UsePhishingBlocker],
O.[UseDisableSmAdsForUsers]
O.[UseDisableSmAdsForUsers],
O.[UseMyItems]
FROM
[dbo].[ProviderUser] PU
INNER JOIN