mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 16:42:50 -05:00
Org API controller and supporting data access
This commit is contained in:
@ -0,0 +1,15 @@
|
||||
CREATE PROCEDURE [dbo].[OrganizationUser_ReadByIdUserId]
|
||||
@Id UNIQUEIDENTIFIER,
|
||||
@UserId UNIQUEIDENTIFIER
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
[dbo].[OrganizationUserView]
|
||||
WHERE
|
||||
[Id] = @Id
|
||||
AND [UserId] = @UserId
|
||||
END
|
@ -0,0 +1,17 @@
|
||||
CREATE PROCEDURE [dbo].[Organization_ReadByIdUserId]
|
||||
@Id UNIQUEIDENTIFIER,
|
||||
@UserId UNIQUEIDENTIFIER
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
O.*
|
||||
FROM
|
||||
[dbo].[OrganizationView] O
|
||||
INNER JOIN
|
||||
[dbo].[OrganizationUser] OU ON O.[Id] = OU.[OrganizationId]
|
||||
WHERE
|
||||
O.[Id] = @Id
|
||||
AND OU.[UserId] = @UserId
|
||||
END
|
15
src/Sql/dbo/Stored Procedures/Organization_ReadByUserId.sql
Normal file
15
src/Sql/dbo/Stored Procedures/Organization_ReadByUserId.sql
Normal file
@ -0,0 +1,15 @@
|
||||
CREATE PROCEDURE [dbo].[Organization_ReadByUserId]
|
||||
@UserId UNIQUEIDENTIFIER
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
O.*
|
||||
FROM
|
||||
[dbo].[OrganizationView] O
|
||||
INNER JOIN
|
||||
[dbo].[OrganizationUser] OU ON O.[Id] = OU.[OrganizationId]
|
||||
WHERE
|
||||
OU.[UserId] = @UserId
|
||||
END
|
6
src/Sql/dbo/Views/OrganizationUserView.sql
Normal file
6
src/Sql/dbo/Views/OrganizationUserView.sql
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE VIEW [dbo].[OrganizationUserView]
|
||||
AS
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
[dbo].[OrganizationUser]
|
6
src/Sql/dbo/Views/OrganizationView.sql
Normal file
6
src/Sql/dbo/Views/OrganizationView.sql
Normal file
@ -0,0 +1,6 @@
|
||||
CREATE VIEW [dbo].[OrganizationView]
|
||||
AS
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
[dbo].[Organization]
|
Reference in New Issue
Block a user