mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 16:42:50 -05:00
org user management apis
This commit is contained in:
@ -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