1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 16:42:50 -05:00

return share information with cipher API response

This commit is contained in:
Kyle Spearrin
2017-02-21 22:52:02 -05:00
parent 8051995cc7
commit 900e71d4dd
11 changed files with 123 additions and 15 deletions

View File

@ -109,5 +109,8 @@
<Build Include="dbo\Stored Procedures\Grant_ReadBySubjectId.sql" />
<Build Include="dbo\Stored Procedures\Grant_Save.sql" />
<Build Include="dbo\Stored Procedures\User_ReadAccountRevisionDateById.sql" />
<Build Include="dbo\Views\CipherShareView.sql" />
<Build Include="dbo\Stored Procedures\CipherShare_ReadByUserId.sql" />
<Build Include="dbo\Stored Procedures\CipherShare_ReadById.sql" />
</ItemGroup>
</Project>

View File

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

View File

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

View File

@ -0,0 +1,11 @@
CREATE VIEW [dbo].[CipherShareView]
AS
SELECT
C.*,
S.[Key],
S.[Permissions],
S.[Status]
FROM
[dbo].[Cipher] C
LEFT JOIN
[dbo].[Share] S ON C.[Id] = S.[CipherId]