1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-17 15:40:59 -05:00

Hide email address in Sends (#1234)

* Add send HideEmail to tables and models

* Respect HideEmail setting for Sends

* Recreate SendView to include new HideEmail column

* Enforce new Send policy

* Insert default value for new HideEmail column

* Delete c95d7598-71cc-4eab-8b08-aced0045198b.json

* Remove unrelated files

* Revert disableSendPolicy, add sendOptionsPolicy

* Minor style fixes

* Update SQL project with Send.HideEmail column

* unit test SendOptionsPolicy.DisableHideEmail

* Add SendOptionsPolicy to Portal

* Make HideEmail nullable, fix migrator script

* Remove NOT NULL constraint from HideEmail

* Fix style

* Make HideEmail nullable

* minor fixes to model and error message

* Move SendOptionsExemption banner

Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com>
This commit is contained in:
Thomas Rittson
2021-03-29 07:56:56 +10:00
committed by GitHub
parent 94249747b4
commit 688cc00d48
17 changed files with 334 additions and 17 deletions

View File

@ -12,7 +12,8 @@
@RevisionDate DATETIME2(7),
@ExpirationDate DATETIME2(7),
@DeletionDate DATETIME2(7),
@Disabled BIT
@Disabled BIT,
@HideEmail BIT
AS
BEGIN
SET NOCOUNT ON
@ -32,7 +33,8 @@ BEGIN
[RevisionDate],
[ExpirationDate],
[DeletionDate],
[Disabled]
[Disabled],
[HideEmail]
)
VALUES
(
@ -49,7 +51,8 @@ BEGIN
@RevisionDate,
@ExpirationDate,
@DeletionDate,
@Disabled
@Disabled,
@HideEmail
)
IF @UserId IS NOT NULL
@ -61,4 +64,4 @@ BEGIN
EXEC [dbo].[User_BumpAccountRevisionDate] @UserId
END
-- TODO: OrganizationId bump?
END
END

View File

@ -12,7 +12,8 @@
@RevisionDate DATETIME2(7),
@ExpirationDate DATETIME2(7),
@DeletionDate DATETIME2(7),
@Disabled BIT
@Disabled BIT,
@HideEmail BIT
AS
BEGIN
SET NOCOUNT ON
@ -32,7 +33,8 @@ BEGIN
[RevisionDate] = @RevisionDate,
[ExpirationDate] = @ExpirationDate,
[DeletionDate] = @DeletionDate,
[Disabled] = @Disabled
[Disabled] = @Disabled,
[HideEmail] = @HideEmail
WHERE
[Id] = @Id
@ -41,4 +43,4 @@ BEGIN
EXEC [dbo].[User_BumpAccountRevisionDate] @UserId
END
-- TODO: OrganizationId bump?
END
END

View File

@ -13,6 +13,7 @@
[ExpirationDate] DATETIME2 (7) NULL,
[DeletionDate] DATETIME2 (7) NOT NULL,
[Disabled] BIT NOT NULL,
[HideEmail] BIT NULL,
CONSTRAINT [PK_Send] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [FK_Send_Organization] FOREIGN KEY ([OrganizationId]) REFERENCES [dbo].[Organization] ([Id]),
CONSTRAINT [FK_Send_User] FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([Id])