mirror of
https://github.com/bitwarden/server
synced 2026-03-01 10:51:26 +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:
3574
util/PostgresMigrations/Migrations/20260224100000_AddUseMyItemsToOrganization.Designer.cs
generated
Normal file
3574
util/PostgresMigrations/Migrations/20260224100000_AddUseMyItemsToOrganization.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,28 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bit.PostgresMigrations.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class AddUseMyItemsToOrganization : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "UseMyItems",
|
||||
table: "Organization",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "UseMyItems",
|
||||
table: "Organization");
|
||||
}
|
||||
}
|
||||
3574
util/PostgresMigrations/Migrations/20260224100001_UseMyItemsDataMigration.Designer.cs
generated
Normal file
3574
util/PostgresMigrations/Migrations/20260224100001_UseMyItemsDataMigration.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bit.PostgresMigrations.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class UseMyItemsDataMigration : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql(@"
|
||||
UPDATE ""Organization""
|
||||
SET ""UseMyItems"" = true
|
||||
WHERE ""UsePolicies"" = true;
|
||||
");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql(@"
|
||||
UPDATE ""Organization""
|
||||
SET ""UseMyItems"" = false
|
||||
WHERE ""UsePolicies"" = true;
|
||||
");
|
||||
}
|
||||
}
|
||||
@@ -243,6 +243,9 @@ namespace Bit.PostgresMigrations.Migrations
|
||||
b.Property<bool>("UseKeyConnector")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("UseMyItems")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("UseOrganizationDomains")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user