1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-25 12:45:18 +01:00

read subvaults by confirmed admin user

This commit is contained in:
Kyle Spearrin 2017-03-29 22:23:26 -04:00
parent 95fdfeb519
commit ab173cf5cf
3 changed files with 21 additions and 0 deletions

View File

@ -179,5 +179,6 @@
<Build Include="dbo\Stored Procedures\Cipher_UpdatePartial.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_ReadByOrganizationIdEmail.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUser_ReadByOrganizationId.sql" />
<Build Include="dbo\Stored Procedures\Subvault_ReadByIdAdminUserId.sql" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,19 @@
CREATE PROCEDURE [dbo].[Subvault_ReadByIdAdminUserId]
@Id UNIQUEIDENTIFIER,
@UserId UNIQUEIDENTIFIER
AS
BEGIN
SET NOCOUNT ON
SELECT
S.*
FROM
[dbo].[SubvaultView] S
INNER JOIN
[OrganizationUser] OU ON OU.[OrganizationId] = S.[OrganizationId]
WHERE
S.[Id] = @Id
AND OU.[UserId] = @UserId
AND OU.[Status] = 2 -- Confirmed
AND OU.[Type] <= 1 -- Owner and admin
END

View File

@ -14,5 +14,6 @@ BEGIN
WHERE
S.[OrganizationId] = @OrganizationId
AND OU.[UserId] = @UserId
AND OU.[Status] = 2 -- Confirmed
AND OU.[Type] <= 1 -- Owner and admin
END