1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-17 23:50:58 -05:00

apis for org vault listing

This commit is contained in:
Kyle Spearrin
2017-04-17 17:01:23 -04:00
parent 5b76c43fb0
commit 0e5799f7c8
10 changed files with 118 additions and 7 deletions

View File

@ -174,5 +174,7 @@
<Build Include="dbo\Stored Procedures\OrganizationUserUserDetails_ReadById.sql" />
<Build Include="dbo\Stored Procedures\OrganizationUserUserDetails_ReadByOrganizationId.sql" />
<Build Include="dbo\User Defined Types\GuidIdArray.sql" />
<Build Include="dbo\Stored Procedures\Cipher_ReadByOrganizationId.sql" />
<Build Include="dbo\Stored Procedures\SubvaultCipher_ReadByOrganizationId.sql" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,13 @@
CREATE PROCEDURE [dbo].[Cipher_ReadByOrganizationId]
@OrganizationId UNIQUEIDENTIFIER
AS
BEGIN
SET NOCOUNT ON
SELECT
*
FROM
[dbo].[CipherView]
WHERE
[OrganizationId] = @OrganizationId
END

View File

@ -0,0 +1,15 @@
CREATE PROCEDURE [dbo].[SubvaultCipher_ReadByOrganizationId]
@OrganizationId UNIQUEIDENTIFIER
AS
BEGIN
SET NOCOUNT ON
SELECT
SC.*
FROM
[dbo].[SubvaultCipher] SC
INNER JOIN
[dbo].[Subvault] S ON S.[Id] = SC.[SubvaultId]
WHERE
S.[OrganizationId] = @OrganizationId
END

View File

@ -18,6 +18,12 @@ CREATE NONCLUSTERED INDEX [IX_Cipher_UserId_Type]
ON [dbo].[Cipher]([UserId] ASC, [Type] ASC);
GO
CREATE NONCLUSTERED INDEX [IX_Cipher_OrganizationId_Type]
ON [dbo].[Cipher]([OrganizationId] ASC, [Type] ASC)
WHERE [OrganizationId] IS NOT NULL;
GO
CREATE TRIGGER [dbo].[Cipher_Inserted]
ON [dbo].[Cipher] AFTER INSERT