1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 00:52:49 -05:00

org user details apis

This commit is contained in:
Kyle Spearrin
2017-03-06 20:51:13 -05:00
parent 5ac2113cac
commit 7ca8629a13
15 changed files with 117 additions and 40 deletions

View File

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

View File

@ -1,4 +1,4 @@
CREATE PROCEDURE [dbo].[OrganizationUserDetails_ReadById]
CREATE PROCEDURE [dbo].[OrganizationUserUserDetails_ReadById]
@Id UNIQUEIDENTIFIER
AS
BEGIN
@ -7,7 +7,7 @@ BEGIN
SELECT
*
FROM
[dbo].[OrganizationUserDetailsView]
[dbo].[OrganizationUserUserDetailsView]
WHERE
[Id] = @Id
END

View File

@ -1,4 +1,4 @@
CREATE PROCEDURE [dbo].[OrganizationUserDetails_ReadByOrganizationId]
CREATE PROCEDURE [dbo].[OrganizationUserUserDetails_ReadByOrganizationId]
@OrganizationId UNIQUEIDENTIFIER
AS
BEGIN
@ -7,7 +7,7 @@ BEGIN
SELECT
*
FROM
[dbo].[OrganizationUserDetailsView]
[dbo].[OrganizationUserUserDetailsView]
WHERE
[OrganizationId] = @OrganizationId
END

View File

@ -0,0 +1,12 @@
CREATE VIEW [dbo].[OrganizationUserOrganizationDetailsView]
AS
SELECT
OU.[UserId],
OU.[OrganizationId],
O.[Name],
OU.[Key],
OU.[Status]
FROM
[dbo].[OrganizationUser] OU
INNER JOIN
[dbo].[Organization] O ON O.[Id] = OU.[OrganizationId]

View File

@ -1,4 +1,4 @@
CREATE VIEW [dbo].[OrganizationUserDetailsView]
CREATE VIEW [dbo].[OrganizationUserUserDetailsView]
AS
SELECT
OU.[Id],
@ -11,4 +11,4 @@ SELECT
FROM
[dbo].[OrganizationUser] OU
LEFT JOIN
[dbo].[User] U ON U.Id = OU.UserId
[dbo].[User] U ON U.[Id] = OU.[UserId]