mirror of
https://github.com/bitwarden/server.git
synced 2025-02-23 03:01:23 +01:00
limit collection users with accessall to orgid
This commit is contained in:
parent
94fdb72d75
commit
5b5bd4e099
@ -6,6 +6,7 @@ namespace Bit.Core.Models.Data
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public Guid OrganizationUserId { get; set; }
|
||||
public Guid? OrganizationId { get; set; }
|
||||
public Guid? CollectionId { get; set; }
|
||||
public bool AccessAll { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
@ -4,11 +4,17 @@ AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
DECLARE @OrganizationId UNIQUEIDENTIFIER = (SELECT [OrganizationId] FROM [dbo].[Collection] WHERE [Id] = @CollectionId)
|
||||
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
[dbo].[CollectionUserUserDetailsView]
|
||||
WHERE
|
||||
[AccessAll] = 1
|
||||
OR [CollectionId] = @CollectionId
|
||||
END
|
||||
[CollectionId] = @CollectionId
|
||||
OR
|
||||
(
|
||||
[OrganizationId] = @OrganizationId
|
||||
AND [AccessAll] = 1
|
||||
)
|
||||
END
|
||||
|
@ -2,6 +2,7 @@
|
||||
AS
|
||||
SELECT
|
||||
OU.[Id] AS [OrganizationUserId],
|
||||
OU.[OrganizationId],
|
||||
OU.[AccessAll],
|
||||
CU.[Id],
|
||||
CU.[CollectionId],
|
||||
|
Loading…
Reference in New Issue
Block a user