mirror of
https://github.com/bitwarden/server.git
synced 2025-04-06 05:28:15 -05:00
dont set userid on cipher if orgid is set
This commit is contained in:
parent
39cc487667
commit
4e8a313d3d
@ -29,7 +29,7 @@ BEGIN
|
||||
VALUES
|
||||
(
|
||||
@Id,
|
||||
@UserId,
|
||||
CASE WHEN @OrganizationId IS NULL THEN @UserId ELSE NULL END,
|
||||
@OrganizationId,
|
||||
@Type,
|
||||
@Data,
|
||||
|
@ -429,3 +429,62 @@ BEGIN
|
||||
SELECT 0 -- 0 = Success
|
||||
END
|
||||
GO
|
||||
|
||||
IF OBJECT_ID('[dbo].[Cipher_Create]') IS NOT NULL
|
||||
BEGIN
|
||||
DROP PROCEDURE [dbo].[Cipher_Create]
|
||||
END
|
||||
GO
|
||||
|
||||
CREATE PROCEDURE [dbo].[Cipher_Create]
|
||||
@Id UNIQUEIDENTIFIER,
|
||||
@UserId UNIQUEIDENTIFIER,
|
||||
@OrganizationId UNIQUEIDENTIFIER,
|
||||
@Type TINYINT,
|
||||
@Data NVARCHAR(MAX),
|
||||
@Favorites NVARCHAR(MAX),
|
||||
@Folders NVARCHAR(MAX),
|
||||
@Attachments NVARCHAR(MAX),
|
||||
@CreationDate DATETIME2(7),
|
||||
@RevisionDate DATETIME2(7)
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
INSERT INTO [dbo].[Cipher]
|
||||
(
|
||||
[Id],
|
||||
[UserId],
|
||||
[OrganizationId],
|
||||
[Type],
|
||||
[Data],
|
||||
[Favorites],
|
||||
[Folders],
|
||||
[Attachments],
|
||||
[CreationDate],
|
||||
[RevisionDate]
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
@Id,
|
||||
CASE WHEN @OrganizationId IS NULL THEN @UserId ELSE NULL END,
|
||||
@OrganizationId,
|
||||
@Type,
|
||||
@Data,
|
||||
@Favorites,
|
||||
@Folders,
|
||||
@Attachments,
|
||||
@CreationDate,
|
||||
@RevisionDate
|
||||
)
|
||||
|
||||
IF @OrganizationId IS NOT NULL
|
||||
BEGIN
|
||||
EXEC [dbo].[User_BumpAccountRevisionDateByCipherId] @Id, @OrganizationId
|
||||
END
|
||||
ELSE IF @UserId IS NOT NULL
|
||||
BEGIN
|
||||
EXEC [dbo].[User_BumpAccountRevisionDate] @UserId
|
||||
END
|
||||
END
|
||||
GO
|
||||
|
Loading…
x
Reference in New Issue
Block a user