1
0
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:
Kyle Spearrin 2017-05-04 07:17:01 -04:00
parent 94fdb72d75
commit 5b5bd4e099
3 changed files with 11 additions and 3 deletions

View File

@ -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; }

View File

@ -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

View File

@ -2,6 +2,7 @@
AS
SELECT
OU.[Id] AS [OrganizationUserId],
OU.[OrganizationId],
OU.[AccessAll],
CU.[Id],
CU.[CollectionId],