mirror of
https://github.com/bitwarden/server
synced 2026-01-07 19:13:50 +00:00
* 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>
68 lines
1.4 KiB
Transact-SQL
68 lines
1.4 KiB
Transact-SQL
CREATE PROCEDURE [dbo].[Send_Create]
|
|
@Id UNIQUEIDENTIFIER,
|
|
@UserId UNIQUEIDENTIFIER,
|
|
@OrganizationId UNIQUEIDENTIFIER,
|
|
@Type TINYINT,
|
|
@Data VARCHAR(MAX),
|
|
@Key VARCHAR(MAX),
|
|
@Password NVARCHAR(300),
|
|
@MaxAccessCount INT,
|
|
@AccessCount INT,
|
|
@CreationDate DATETIME2(7),
|
|
@RevisionDate DATETIME2(7),
|
|
@ExpirationDate DATETIME2(7),
|
|
@DeletionDate DATETIME2(7),
|
|
@Disabled BIT,
|
|
@HideEmail BIT
|
|
AS
|
|
BEGIN
|
|
SET NOCOUNT ON
|
|
|
|
INSERT INTO [dbo].[Send]
|
|
(
|
|
[Id],
|
|
[UserId],
|
|
[OrganizationId],
|
|
[Type],
|
|
[Data],
|
|
[Key],
|
|
[Password],
|
|
[MaxAccessCount],
|
|
[AccessCount],
|
|
[CreationDate],
|
|
[RevisionDate],
|
|
[ExpirationDate],
|
|
[DeletionDate],
|
|
[Disabled],
|
|
[HideEmail]
|
|
)
|
|
VALUES
|
|
(
|
|
@Id,
|
|
@UserId,
|
|
@OrganizationId,
|
|
@Type,
|
|
@Data,
|
|
@Key,
|
|
@Password,
|
|
@MaxAccessCount,
|
|
@AccessCount,
|
|
@CreationDate,
|
|
@RevisionDate,
|
|
@ExpirationDate,
|
|
@DeletionDate,
|
|
@Disabled,
|
|
@HideEmail
|
|
)
|
|
|
|
IF @UserId IS NOT NULL
|
|
BEGIN
|
|
IF @Type = 1 --File
|
|
BEGIN
|
|
EXEC [dbo].[User_UpdateStorage] @UserId
|
|
END
|
|
EXEC [dbo].[User_BumpAccountRevisionDate] @UserId
|
|
END
|
|
-- TODO: OrganizationId bump?
|
|
END
|