mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
Fix conflicting group permissions (#1473)
* Return collection with highest permission levels
* Revert "Return collection with highest permission levels"
This reverts commit 06e0f3b73e
.
* Combine duplicate collectionDetails
* Update EF to combine duplicate CollectionDetails
* Delete unneeded using statements
This commit is contained in:
@ -0,0 +1,66 @@
|
||||
IF OBJECT_ID('[dbo].[Collection_ReadByUserId]') IS NOT NULL
|
||||
BEGIN
|
||||
DROP PROCEDURE [dbo].[Collection_ReadByUserId]
|
||||
END
|
||||
GO
|
||||
|
||||
CREATE PROCEDURE [dbo].[Collection_ReadByUserId]
|
||||
@UserId UNIQUEIDENTIFIER
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
Id,
|
||||
OrganizationId,
|
||||
[Name],
|
||||
CreationDate,
|
||||
RevisionDate,
|
||||
ExternalId,
|
||||
MIN([ReadOnly]) AS [ReadOnly],
|
||||
MIN([HidePasswords]) AS [HidePasswords]
|
||||
FROM
|
||||
[dbo].[UserCollectionDetails](@UserId)
|
||||
GROUP BY
|
||||
Id,
|
||||
OrganizationId,
|
||||
[Name],
|
||||
CreationDate,
|
||||
RevisionDate,
|
||||
ExternalId
|
||||
END
|
||||
GO
|
||||
|
||||
IF OBJECT_ID('[dbo].[Collection_ReadByIdUserId]') IS NOT NULL
|
||||
BEGIN
|
||||
DROP PROCEDURE [dbo].[Collection_ReadByIdUserId]
|
||||
END
|
||||
GO
|
||||
|
||||
CREATE PROCEDURE [dbo].[Collection_ReadByIdUserId]
|
||||
@Id UNIQUEIDENTIFIER,
|
||||
@UserId UNIQUEIDENTIFIER
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
SELECT
|
||||
Id,
|
||||
OrganizationId,
|
||||
[Name],
|
||||
CreationDate,
|
||||
RevisionDate,
|
||||
ExternalId,
|
||||
MIN([ReadOnly]) AS [ReadOnly],
|
||||
MIN([HidePasswords]) AS [HidePasswords]
|
||||
FROM
|
||||
[dbo].[UserCollectionDetails](@UserId)
|
||||
WHERE
|
||||
[Id] = @Id
|
||||
GROUP BY
|
||||
Id,
|
||||
OrganizationId,
|
||||
[Name],
|
||||
CreationDate,
|
||||
RevisionDate,
|
||||
ExternalId
|
||||
END
|
Reference in New Issue
Block a user