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:
@ -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>
|
13
src/Sql/dbo/Stored Procedures/CipherShare_ReadById.sql
Normal file
13
src/Sql/dbo/Stored Procedures/CipherShare_ReadById.sql
Normal 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
|
13
src/Sql/dbo/Stored Procedures/CipherShare_ReadByUserId.sql
Normal file
13
src/Sql/dbo/Stored Procedures/CipherShare_ReadByUserId.sql
Normal 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
|
11
src/Sql/dbo/Views/CipherShareView.sql
Normal file
11
src/Sql/dbo/Views/CipherShareView.sql
Normal 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]
|
Reference in New Issue
Block a user