mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 00:52:49 -05:00
org user management apis
This commit is contained in:
@ -142,5 +142,9 @@
|
||||
<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\OrganizationUserDetailsView.sql" />
|
||||
<Build Include="dbo\Stored Procedures\OrganizationUserDetails_ReadById.sql" />
|
||||
<Build Include="dbo\Stored Procedures\OrganizationUserDetails_ReadByOrganizationId.sql" />
|
||||
<Build Include="dbo\Stored Procedures\User_ReadPublicKeyById.sql" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -0,0 +1,13 @@
|
||||
CREATE PROCEDURE [dbo].[OrganizationUserDetails_ReadById]
|
||||
@Id UNIQUEIDENTIFIER
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
[dbo].[OrganizationUserDetailsView]
|
||||
WHERE
|
||||
[Id] = @Id
|
||||
END
|
@ -0,0 +1,13 @@
|
||||
CREATE PROCEDURE [dbo].[OrganizationUserDetails_ReadByOrganizationId]
|
||||
@OrganizationId UNIQUEIDENTIFIER
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
[dbo].[OrganizationUserDetailsView]
|
||||
WHERE
|
||||
[OrganizationId] = @OrganizationId
|
||||
END
|
13
src/Sql/dbo/Stored Procedures/User_ReadPublicKeyById.sql
Normal file
13
src/Sql/dbo/Stored Procedures/User_ReadPublicKeyById.sql
Normal file
@ -0,0 +1,13 @@
|
||||
CREATE PROCEDURE [dbo].[User_ReadPublicKeyById]
|
||||
@Id NVARCHAR(50)
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
[PublicKey]
|
||||
FROM
|
||||
[dbo].[User]
|
||||
WHERE
|
||||
[Id] = @Id
|
||||
END
|
14
src/Sql/dbo/Views/OrganizationUserDetailsView.sql
Normal file
14
src/Sql/dbo/Views/OrganizationUserDetailsView.sql
Normal file
@ -0,0 +1,14 @@
|
||||
CREATE VIEW [dbo].[OrganizationUserDetailsView]
|
||||
AS
|
||||
SELECT
|
||||
OU.[Id],
|
||||
OU.[UserId],
|
||||
OU.[OrganizationId],
|
||||
U.[Name],
|
||||
ISNULL(U.[Email], OU.[Email]) Email,
|
||||
OU.[Status],
|
||||
OU.[Type]
|
||||
FROM
|
||||
[dbo].[OrganizationUser] OU
|
||||
LEFT JOIN
|
||||
[dbo].[User] U ON U.Id = OU.UserId
|
Reference in New Issue
Block a user